HonoH
Hono2y ago
Thanzex

Sentry middleware incomplete report

I want to use Hono + Sentry, the target environment is Cloudflare, but for now I'm running it locally.
here's a simplified version of my code:
const app = new Hono<AppType>()
app.use(sentry())

app.get('path', async (c) => {
  ...
  if (result.status == 200) {
    return c.json(result.body);
  } else {
    throw new HTTPException(result.status || 500, {
      message: result.message,
    });
  }
})


In case of an error the result.message always exists, and I can see the correct status and message returned when I call the api.

In sentry, however, the only thing i see is:
Error<anonymous>(index)
No error message

mechanism:generic handled:true
...
Status: unknown


Am i supposed to call the sentry object and annotate each and every situation?
I thought that at least the code and error message would be reported
Was this page helpful?