mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
feat: add Sentry error tracking with PII scrubbing
This commit is contained in:
@@ -73,6 +73,12 @@ app.setErrorHandler((error: Error & { statusCode?: number }, request, reply) =>
|
||||
{ err: error, url: request.url, method: request.method },
|
||||
"Unhandled request error",
|
||||
);
|
||||
try {
|
||||
const Sentry = require("@sentry/node") as typeof import("@sentry/node");
|
||||
Sentry.captureException(error);
|
||||
} catch {
|
||||
// Sentry not available
|
||||
}
|
||||
const isProduction = process.env.NODE_ENV === "production";
|
||||
reply.status(statusCode).send({
|
||||
error: statusCode >= 500 ? "Internal server error" : error.message,
|
||||
|
||||
Reference in New Issue
Block a user