MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / sentry

Function sentry

packages/hono/src/bun/middleware.ts:14–28  ·  view source on GitHub ↗
(app: Hono<E>, options: HonoBunOptions)

Source from the content-addressed store, hash-verified

12 * Sentry middleware for Hono running in a Bun runtime environment.
13 */
14export const sentry = <E extends Env>(app: Hono<E>, options: HonoBunOptions): MiddlewareHandler => {
15 options.debug && debug.log('Initialized Sentry Hono middleware (Bun)');
16
17 init(options);
18
19 applyPatches(app);
20
21 return async (context, next) => {
22 requestHandler(context, getConnInfo);
23
24 await next(); // Handler runs in between Request above ⤴ and Response below ⤵
25
26 responseHandler(context, options.shouldHandleError);
27 };
28};

Callers 12

middleware.test.tsFile · 0.90
middleware.test.tsFile · 0.90
middleware.test.tsFile · 0.90
middleware.test.tsFile · 0.90
entry.bun.tsFile · 0.90
index.tsFile · 0.90
astro.config.mjsFile · 0.50
astro.config.mjsFile · 0.50
astro.config.mjsFile · 0.50
astro.config.mjsFile · 0.50
astro.config.mjsFile · 0.50
astro.config.mjsFile · 0.50

Calls 6

initFunction · 0.90
applyPatchesFunction · 0.90
requestHandlerFunction · 0.90
responseHandlerFunction · 0.90
nextFunction · 0.85
logMethod · 0.65

Tested by

no test coverage detected