Skip to content

express process termination with async exceptions #5931

Closed
@ljearyscg

Description

@ljearyscg

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/node

SDK Version

7.14.2

Framework Version

No response

Link to Sentry event

No response

Steps to Reproduce

  1. create new express node project from https://github.com/sentry-demos/express
  2. upgraded sentry to 7.14.2
  3. added an async request with a reject
app.get('/unhandledasync', async function () {
    Promise.reject('failure to handle async')
});
  1. add basic error handler that will respond with 501 and possibly send an error object back
app.use((error,_req,res,next) => {
    console.log('500')
    res
      .status(501)
      .send(error)
    next(error)
  })
  1. call the async reject /unhandledasync using curl

this is a change in version 7.12
version 7.11 worked as expected

image

Expected Result

for sentry to call next when it received an error that is asynchronous and allow the following handler 'custom error handler) process the response

image

Actual Result

the exception is unhandled and the process is terminated.

when /unhandled is called the process works as expected

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: nodeIssues related to the Sentry Node SDK

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions