serverless-express icon indicating copy to clipboard operation
serverless-express copied to clipboard

Express and custom error middleware

Open nathanqg opened this issue 3 years ago • 0 comments

Hello 👋

I'm using the package with an Express server. I've registered a custom error middleware to catch any errors that might have happened since the request arrived, but my custom error middleware seems to be overwritten and ignored by a default error middleware that always returns 500. I'm not sure if this is expected or a bug, but is it possible to use custom error middleware with Express or do we need to treat any error in the route handlers?

Thanks!

nathanqg avatar Apr 26 '22 15:04 nathanqg