fastboot-express-middleware icon indicating copy to clipboard operation
fastboot-express-middleware copied to clipboard

Test that tests resilient mode without custom error handler incorrect

Open sdhull opened this issue 6 years ago • 0 comments

Calling all knowledgeable Express.js folks!

The test case in this repo that tests resilient mode without a custom error handler should fail (eg, it does IRL when using resilient mode without a custom error handler), but for some reason it passes.

My impression from reading the docs is that the default Express error handler will render the built-in error page when it gets called, which will in turn subvert the resilient behavior.

So you actually must define an error handler like

app.use(function (err, req, res, next) {
  console.error(err.stack)
  next();
})

To essentially ignore the error and allow resilient mode to continue.

But the tests don't reflect that. Are they somehow turning off the default error handler in express?

sdhull avatar Jul 16 '19 21:07 sdhull