Skip to content

Commit

Permalink
fix: do not submit ECONNABORTED errors to Sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
kewitz committed Jan 31, 2025
1 parent 8ec2ae5 commit 77b8c58
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/middleware/error-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const isKnownError = error => {
}
};

const IgnoredErrorCodes = ['ECONNABORTED'];

/**
* error handler of the api
*/
Expand Down Expand Up @@ -58,7 +60,7 @@ export default (err, req, res, next) => {
logger.error(`Express Error: ${err.message}`);

// Log unknown errors to Sentry
if (!isKnownError(err)) {
if (!IgnoredErrorCodes.includes(err.code) && !isKnownError(err)) {
try {
reportErrorToSentry(err, {
handler: HandlerType.EXPRESS,
Expand Down

0 comments on commit 77b8c58

Please sign in to comment.