ref: refactorise la configuration du SDK Sentry
This commit is contained in:
parent
eb7e1ec69f
commit
80a992a583
4 changed files with 17 additions and 16 deletions
|
|
@ -1 +1 @@
|
|||
{ "dictionaries": ["fr-fr", "en-gb"], "words": ["oxlint", "Vali", "mobily", "valibot"] }
|
||||
{ "dictionaries": ["fr-fr", "en-gb"], "words": ["oxlint", "Vali", "mobily", "valibot", "GLITCHTIP"] }
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
- MÉTHODES DE LIVRAISON
|
||||
- [ ] Proposer la livraison à domicile en Belgique et en France pour le coût unique de 8 euros, quel que soit le montant de la commande
|
||||
- PAGE PRODUIT
|
||||
- Corriger la grille des détails pour les Produits Simples.
|
||||
- PIED DE PAGE
|
||||
- Réduire la hauteur.
|
||||
- TOUTES LES PAGES
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ import type { Transport, TransportMakeRequestResponse, TransportRequest } from "
|
|||
import { pipe } from "@mobily/ts-belt";
|
||||
import {
|
||||
breadcrumbsIntegration,
|
||||
browserApiErrorsIntegration,
|
||||
BrowserClient,
|
||||
captureConsoleIntegration,
|
||||
createTransport,
|
||||
dedupeIntegration,
|
||||
defaultStackParser,
|
||||
functionToStringIntegration,
|
||||
|
|
@ -19,13 +19,12 @@ import {
|
|||
httpContextIntegration,
|
||||
linkedErrorsIntegration,
|
||||
} from "@sentry/browser";
|
||||
|
||||
import type { BrowserTransportOptions } from "./lib/types/sentry";
|
||||
import { createTransport } from "@sentry/core";
|
||||
|
||||
import { ENTETE_GLITCHTIP_RATE_LIMITS, ENTETE_GLITCHTIP_RETRY_AFTER } from "./constantes/api";
|
||||
|
||||
/* Créé la fonction génératrice de la requête auprès de GlitchTip */
|
||||
const creeTransportFetch = (options: BrowserTransportOptions): Transport => {
|
||||
const creeTransportFetch = (options): Transport => {
|
||||
const creeRequete = async (requete: TransportRequest): Promise<TransportMakeRequestResponse> => {
|
||||
const optionsRequete: RequestInit = {
|
||||
body: requete.body,
|
||||
|
|
@ -56,13 +55,25 @@ const client = new BrowserClient({
|
|||
dsn: import.meta.env.VITE_GLITCHTIP_NSD,
|
||||
environment: import.meta.env.VITE_MODE,
|
||||
integrations: [
|
||||
// Wraps native browser APIs to capture breadcrumbs.
|
||||
breadcrumbsIntegration(),
|
||||
// Wraps native time and events APIs in `try/catch` blocks to handle async exceptions
|
||||
browserApiErrorsIntegration(),
|
||||
// Captures all Console API calls via `captureException` or `captureMessage`.
|
||||
captureConsoleIntegration({ levels: ["warn", "error"] }),
|
||||
// Deduplicate certain events to avoid receiving duplicate errors.
|
||||
dedupeIntegration(),
|
||||
// Allows the SDK to provide original functions and method names, even when those functions or methods are wrapped by our error or breadcrumb handlers.
|
||||
functionToStringIntegration(),
|
||||
// Attaches global handlers to capture uncaught exceptions and unhandled rejections.
|
||||
globalHandlersIntegration(),
|
||||
httpClientIntegration(),
|
||||
// Captures errors on failed requests from Fetch and XHR and attaches request and response information.
|
||||
httpClientIntegration({
|
||||
failedRequestStatusCodes: [[400, 599]],
|
||||
}),
|
||||
// Attaches HTTP request information, such as URL, user-agent, referrer, and other headers to the event.
|
||||
httpContextIntegration(),
|
||||
// Allows you to configure linked errors.
|
||||
linkedErrorsIntegration(),
|
||||
],
|
||||
sendDefaultPii: true,
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
import type { BaseTransportOptions } from "@sentry/types";
|
||||
|
||||
/* Recréé une Interface non exposé par Sentry */
|
||||
export interface BrowserTransportOptions extends BaseTransportOptions {
|
||||
/** Fetch API init parameters. Used by the FetchTransport */
|
||||
fetchOptions?: RequestInit;
|
||||
/** Custom headers for the transport. Used by the XHRTransport and FetchTransport */
|
||||
headers?: Record<string, string>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue