Closed komninoschatzipapas closed 3 years ago
Furthermore, Boom errors are sometimes used outside of routes, e.g. on jwt.ts:
if (!jwtKey) {
throw Boom.badImplementation('Empty JWT secret key.')
}
We should just throw regular Error
s in cases like the above.
I like your suggestion and the syntax of returning the http error instead 👍 . Maybe @plmercereau wants to weigh in?
We currently use the
@hapi/boom
package directly for our HTTP errors. I propose we instead use this package which wraps@hapi/boom
as an express middleware.Doing so will result in more testable and clearer code:
vs.