-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide production pmx.expressErrorHandler() example #9
Comments
Perhaps using our own setup would be of some use to see if this is worth discussion. Forgive the CoffeeScript if it isn't your thing. In our case, errors that aren't trivial field validation issues bubble up to the 4-arity handlers for disposition. We've got an error convenience module that wraps the common error codes, and, in the case of anything that'd generate a 500 error, captures a stack trace at the point of instantiation. Therefore any error with a stack present means that Bad Things have happened; any error without one is simply something like a bad request, unauthorized, etc., to send back to the client. Our setup looks like this. One way to handle the problem, anyway; would be nice to see alternatives, best practices, etc., from the PM2 perspective.
|
+1 |
It would be nice to see a production example of the recommended use of pmx.expressErrorHandler().
For example, positioning. Before your own 4-arity functions? After them?
Given that it potentially modifies res.statusCode, I would presume 'after', but I think that a small example here would be very beneficial.
The text was updated successfully, but these errors were encountered: