From b65e4a6169959d60e39d81c6092acafd3b42dc1c Mon Sep 17 00:00:00 2001 From: Yusuke Wada Date: Mon, 10 Oct 2022 01:07:26 +0900 Subject: [PATCH] fix(deno): support new version of Hono --- deno_dist/index.ts | 12 +++++------- deno_test/deps.ts | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/deno_dist/index.ts b/deno_dist/index.ts index 292d1b82..29e7522e 100644 --- a/deno_dist/index.ts +++ b/deno_dist/index.ts @@ -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' -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 { sentry: Toucan } @@ -48,11 +48,9 @@ export const sentry = (options?: Options, callback?: (sentry: Toucan) => void): c.set('sentry', sentry) if (callback) callback(sentry) - try { - await next() - } catch (error) { - sentry.captureException(error) - throw error + await next() + if (c.error) { + sentry.captureException(c.error) } } } diff --git a/deno_test/deps.ts b/deno_test/deps.ts index 519ffa99..514aff38 100644 --- a/deno_test/deps.ts +++ b/deno_test/deps.ts @@ -1,2 +1,2 @@ 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'