1 |
|
2 | import type * as http from 'node:http';
|
3 | export declare const instrumentExpress: ((options?: unknown) => void) & {
|
4 | id: string;
|
5 | };
|
6 | /**
|
7 | * Express integration
|
8 | *
|
9 | * Capture tracing data for express.
|
10 | * In order to capture exceptions, you have to call `setupExpressErrorHandler(app)` before any other middleware and after all controllers.
|
11 | */
|
12 | export declare const expressIntegration: () => import("@sentry/types").Integration;
|
13 | interface MiddlewareError extends Error {
|
14 | status?: number | string;
|
15 | statusCode?: number | string;
|
16 | status_code?: number | string;
|
17 | output?: {
|
18 | statusCode?: number | string;
|
19 | };
|
20 | }
|
21 | type ExpressMiddleware = (error: MiddlewareError, req: http.IncomingMessage, res: http.ServerResponse, next: (error: MiddlewareError) => void) => void;
|
22 | interface ExpressHandlerOptions {
|
23 | |
24 |
|
25 |
|
26 |
|
27 | shouldHandleError?(this: void, error: MiddlewareError): boolean;
|
28 | }
|
29 |
|
30 |
|
31 |
|
32 | export declare function expressErrorHandler(options?: ExpressHandlerOptions): ExpressMiddleware;
|
33 |
|
34 |
|
35 |
|
36 |
|
37 | export declare function setupExpressErrorHandler(app: {
|
38 | use: (middleware: ExpressMiddleware) => unknown;
|
39 | }, options?: ExpressHandlerOptions): void;
|
40 | export {};
|
41 |
|
\ | No newline at end of file |