UNPKG

@sentry/remix

Version:
38 lines 1.67 kB
import type { ActionFunctionArgs, CreateRequestHandlerFunction, LoaderFunctionArgs, ServerBuild } from '@remix-run/server-runtime'; type DataFunctionArgs = LoaderFunctionArgs | ActionFunctionArgs; /** * Sentry utility to be used in place of `handleError` function of Remix v2 * Remix Docs: https://remix.run/docs/en/main/file-conventions/entry.server#handleerror * * Should be used in `entry.server` like: * * export const handleError = Sentry.sentryHandleError */ export declare function sentryHandleError(err: unknown, { request }: DataFunctionArgs): void; /** * Sentry wrapper for Remix's `handleError` function. * Remix Docs: https://remix.run/docs/en/main/file-conventions/entry.server#handleerror */ export declare function wrapHandleErrorWithSentry(origHandleError: (err: unknown, args: { request: unknown; }) => void): (err: unknown, args: { request: unknown; }) => void; /** * Instruments `remix` ServerBuild for performance tracing and error tracking. */ export declare function instrumentBuild<T extends ServerBuild | (() => ServerBuild | Promise<ServerBuild>)>(build: T, options?: { instrumentTracing?: boolean; }): T; export declare const makeWrappedCreateRequestHandler: (options?: { instrumentTracing?: boolean; }) => (origCreateRequestHandler: CreateRequestHandlerFunction) => CreateRequestHandlerFunction; /** * Monkey-patch Remix's `createRequestHandler` from `@remix-run/server-runtime` * which Remix Adapters (https://remix.run/docs/en/v1/api/remix) use underneath. */ export declare function instrumentServer(options?: { instrumentTracing?: boolean; }): void; export {}; //# sourceMappingURL=instrumentServer.d.ts.map