Handling promises errors through express handlers

Skip to first unread message


Dec 30, 2016, 12:34:17 AM12/30/16
to Express
Project specifics:
- Express 4.14
- Q library for promises.
- Winston for logging.

In the project where I'm working on, we're not so sure that we're handling exceptions in the right way. To be more specific, we're handling promise errors inside the catch clause of promises. We're assuming that we must notify the framework about those errors, and we assume that without letting express handle those errors through its error handlers.

- The main question is which is the proper way to handle promise errors in express.js?
- Should we handle promise errors through express.js error handlers?

In order to experiment, I've created a simple express app through express generator and I've created two posts on stackoverflow. I've received an answer, but it didnt work because I receive any time that I try the solution, "req.next is not a function".

Find the posts below:

Any help will be appreciated, thanks in advance, 


Reply all
Reply to author
0 new messages