cmorten / opine

Minimalist web framework for Deno ported from ExpressJS.
https://github.com/cmorten/opine/blob/main/.github/API/api.md
MIT License
854 stars 43 forks source link

[FEATURE] Capture errors from async routes #34

Closed gumberss closed 4 years ago

gumberss commented 4 years ago

Issue

Setup:

If you throw an error in an async route, this error won't be caught for an error route

Details

The error:

The code:

The result expected:

asos-craigmorten commented 4 years ago

Decided this is more of a feature than a bug given it isn't handled behaviour in Express either. However, I very much welcome the change 😄

gumberss commented 4 years ago

Oh no!!! I just noticed I used the 'express-async-errors' in my project (facepalm). Yes, it is a feature hahahaha, sorry