sentry-docs icon indicating copy to clipboard operation
sentry-docs copied to clipboard

[Node.js] Document which errors are captured by error handlers

Open mydea opened this issue 1 year ago • 0 comments

SDK

JavaScript SDK

Description

E.g. setupExpressErrorHandler and similar handlers generally ignore errors <500. We should document which errors are captured/ignored by default, as well as how to change this, if necessary.

Suggested Solution

For example, in Express we look at any of the fields status, statusCode, status_code and output.statusCode, and if either of them is set and <500, we will ignore the error. This should be clearly documented somewhere, as well as explaining how a custom shouldHandleError method can be passed in.

mydea avatar Jan 14 '25 08:01 mydea