2022-08-04 07:54:30 +08:00
|
|
|
import type { Handler } from 'https://raw.githubusercontent.com/honojs/hono/v2.0.6/deno_dist/mod.ts'
|
2022-08-10 03:09:45 +08:00
|
|
|
// import Toucan from '../node_modules/toucan-js/dist/index.d.ts'
|
2022-08-04 07:54:30 +08:00
|
|
|
|
2022-08-10 00:32:06 +08:00
|
|
|
export const sentry = (): Handler => {
|
2022-08-04 07:54:30 +08:00
|
|
|
return async (c, next) => {
|
2022-08-10 03:09:45 +08:00
|
|
|
// const sentry = new Toucan({
|
2022-08-11 03:19:22 +08:00
|
|
|
// dsn: c.env.SENTRY_DSN || || c.env.NEXT_PUBLIC_SENTRY_DSN,
|
2022-08-10 03:09:45 +08:00
|
|
|
// request: c.req,
|
|
|
|
// allowedHeaders: ['user-agent'],
|
|
|
|
// allowedSearchParams: /(.*)/,
|
|
|
|
// })
|
2022-08-10 00:08:36 +08:00
|
|
|
|
2022-08-10 00:32:06 +08:00
|
|
|
// try {
|
2022-08-11 03:19:22 +08:00
|
|
|
await next()
|
2022-08-10 00:32:06 +08:00
|
|
|
// } catch (error) {
|
|
|
|
// sentry.captureException(error)
|
|
|
|
// }
|
2022-08-04 07:54:30 +08:00
|
|
|
}
|
|
|
|
}
|