-
Notifications
You must be signed in to change notification settings - Fork 2
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
error handling middleware #57
Comments
it actually works. we apply it using app.use in controller/index.js actually we copy it from the workshop. haha |
you shouldn't be responding to issues yet... 😉 |
interesting. link me the workshop please when you come to responding to issues |
ok. I think this is defunct becuase the previous line always sends a response? Or is express doing something under the hood? |
I think I see what you're doing now, but using express error-handling middleware would be a better way to do it, check the docs and the link from the first comment. |
how can I see what you did to resolve this issue? |
and why did you close it? |
your error handling middleware has very good intentions, but I don't think it works currently right?
https://github.com/facn2/facnrecipev4/blob/master/src/controllers/error.js
See express docs for more: http://expressjs.com/en/guide/error-handling.html
Or see here for a working example:
next
:https://github.com/foundersandcoders/open-tourism-platform/blob/master/src/controllers/event.js#L7-L14
https://github.com/foundersandcoders/open-tourism-platform/blob/master/src/middleware/finalErrorHandler.js
The text was updated successfully, but these errors were encountered: