How to report a different error in beforeSend #10579
-
Im running Sentry in a Nodejs Express server. Currently, I have the following error middleware: export const errorHandlers = [
errorRouter,
Sentry.Handlers.errorHandler({
shouldHandleError(err: any) {
if (
err.status < 500 &&
err instanceof AppError &&
!(err instanceof UnknownError) &&
!(err instanceof InvalidArgumentError)
) {
return false;
}
return true;
}
}),
errorResponse
]; The idea is to do some error reformatting for clients in As part of the Would love any feedback on the implementation and suggestions for a solution |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Would linking the errors with See a sentry blog post: https://blog.sentry.io/making-your-javascript-projects-less-noisy/#pass-the-original-error-cause |
Beta Was this translation helpful? Give feedback.
Would linking the errors with
error.cause
work here? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/causeSee a sentry blog post: https://blog.sentry.io/making-your-javascript-projects-less-noisy/#pass-the-original-error-cause