mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
feat(api): ✨ Add more Sentry logging
This commit is contained in:
parent
daba8e8178
commit
0bc6a89706
6 changed files with 14 additions and 0 deletions
|
|
@ -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}`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue