We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35788ab commit 4dd5b52Copy full SHA for 4dd5b52
src/index.ts
@@ -33,8 +33,15 @@ Sentry.init({
33
});
34
35
instance.setErrorHandler(async (error, request, reply) => {
36
+ if (error.statusCode && error.statusCode < 500) {
37
+ return reply.send(error);
38
+ } // http-errors are thrown for 4xx errors, which should not be sent to sentry
39
Sentry.captureException(error);
40
instance.log.error(error);
41
+ if (error.statusCode) {
42
43
+ } // If any errors were http-errors pretty much, they shouldn't be overwritten
44
+
45
return reply.status(500).send({
46
statusCode: 500,
47
error: "Internal Server Error",
0 commit comments