fix(deno): support new version of Hono

pull/31/head
Yusuke Wada 2022-10-10 01:07:26 +09:00
parent 2460e82976
commit b65e4a6169
2 changed files with 6 additions and 8 deletions

View File

@ -1,7 +1,7 @@
import type { Context, Handler } from 'https://raw.githubusercontent.com/honojs/hono/v2.0.6/deno_dist/mod.ts' import type { Context, Handler } from 'https://raw.githubusercontent.com/honojs/hono/v2.2.5/deno_dist/mod.ts'
import Toucan from 'https://cdn.skypack.dev/toucan-js@2.6.1' import Toucan from 'https://cdn.skypack.dev/toucan-js@2.6.1'
declare module 'https://raw.githubusercontent.com/honojs/hono/v2.0.6/deno_dist/mod.ts' { declare module 'https://raw.githubusercontent.com/honojs/hono/v2.2.5/deno_dist/mod.ts' {
interface ContextVariableMap { interface ContextVariableMap {
sentry: Toucan sentry: Toucan
} }
@ -48,11 +48,9 @@ export const sentry = (options?: Options, callback?: (sentry: Toucan) => void):
c.set('sentry', sentry) c.set('sentry', sentry)
if (callback) callback(sentry) if (callback) callback(sentry)
try {
await next() await next()
} catch (error) { if (c.error) {
sentry.captureException(error) sentry.captureException(c.error)
throw error
} }
} }
} }

View File

@ -1,2 +1,2 @@
export { assert, assertEquals } from 'https://deno.land/std@0.148.0/testing/asserts.ts' export { assert, assertEquals } from 'https://deno.land/std@0.148.0/testing/asserts.ts'
export { Hono } from 'https://deno.land/x/hono@v2.0.6/mod.ts' export { Hono } from 'https://deno.land/x/hono@v2.2.5/mod.ts'