feat(api): Add more Sentry logging

This commit is contained in:
Jesse Wierzbinski 2024-07-24 19:04:00 +02:00
parent daba8e8178
commit 0bc6a89706
No known key found for this signature in database
6 changed files with 14 additions and 0 deletions

View file

@ -1,4 +1,5 @@
import { errorResponse } from "@/response";
import { sentry } from "@/sentry";
import { createMiddleware } from "@hono/hono/factory";
import { getLogger } from "@logtape/logtape";
import type { SocketAddress } from "bun";
@ -25,6 +26,7 @@ export const ipBans = createMiddleware(async (context, next) => {
logger.error`Error while parsing banned IP "${ip}" `;
logger.error`${e}`;
sentry?.captureException(e);
return errorResponse(
`A server error occured: ${(e as Error).message}`,