Add callback

pull/31/head
Samuel Lippert 2022-08-12 14:57:37 -05:00
parent 2b2d05dd16
commit d56da11417
No known key found for this signature in database
GPG Key ID: 3762857AF8948B2C
1 changed files with 6 additions and 1 deletions

View File

@ -17,7 +17,12 @@ class Context implements ExecutionContext {
Deno.test('Sentry Middleware', async () => {
const app = new Hono()
app.use('/sentry/*', sentry())
app.use(
'/sentry/*',
sentry(undefined, (sentry) => {
sentry.captureMessage('foo')
})
)
app.get('/sentry/foo', (c) => c.text('foo'))
app.get('/sentry/error', () => {
throw new Error('a catastrophic error')