From f7c2dfdbb3ef16f5713f75ef287acb1833871f2b Mon Sep 17 00:00:00 2001 From: Samuel Lippert Date: Wed, 3 Aug 2022 18:29:03 -0500 Subject: [PATCH] Add Toucan boilerplate --- src/index.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 116a1866..2fb40972 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,19 @@ import type { Handler } from 'hono' +import Toucan from 'toucan-js' export const hello = (): Handler => { return async (c, next) => { - await next() + const sentry = new Toucan({ + dsn: c.env.SENTRY_DSN, + request: c.req, + allowedHeaders: ['user-agent'], + allowedSearchParams: /(.*)/, + }) + + try { + await next() + } catch (error) { + sentry.captureException(error) + } } }