-
Notifications
You must be signed in to change notification settings - Fork 126
Closed
Description
Hej love the package so far.
But have found that you do not really do promise for Error Handling Middleware the same way as you do other middleware.
This is what I think could help in that regard.
Suggestion: index.js
383. // Execute error middleware
384. for (const err of this._errors) {
385. if (response._state === 'done') break;
386. // Promisify error middleware
387. await new Promise(async (r) => {
388. let rtn = await err(e, response._request, response, () => {
389. r();
390. });
391. if (rtn) response.send(rtn); r();
392. });
393. }
394. // end forAs seen you could implement it the same way as you do for other middleware.
IF there is a reason for not do it this way I really wanna know.
sean-hernon and RobertUpchurch
Metadata
Metadata
Assignees
Labels
No labels