Library usage and examples
Hi,
I was surfing around the internet looking to a good request error-handler for my Express app. Your library popped up like a charm. I know about Merror, which seemed to me well-documented enough to make me more interested on it rather than yours.
I am not myself a web-developer, which means I am interested to make things easy. I was unable to understand how to import/require or even understand how the library operates underneath in the sense to transform the caught error into something consumable. May you explain it?
You have to import the library in your entry point/main file (before you import your routes) like so:
const express = require('express')
require('express-async-errors')
const app = express()
etc...
Because of the library, you do not need the next(exception) call anymore. It handles everything under the hood.