-
-
Notifications
You must be signed in to change notification settings - Fork 36k
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 handlers needed #261
Comments
Just to make sure I'm doing this correctly, does this look right? https://github.com/jameskopacz/freecodecamp/commit/547c1b8fab8a5cd60414a0b9e097456483331c15 |
@jameskopacz looks good. Make the PR and I will merge. There is still one more issue with that file but that can be done in a separate PR if you want. There is a |
Added req.user.save callback I think: #268 |
I can tackle the coursewares, unless someone has claimed those. |
Coursewares error handling (issue #261)
These files need eror handling.
Proper handling tips:
next
as callback in express middlewareEnd Early
Whenever an error exist in express middleware, the callback function should be ended by returning the callback call with err as the first argument. What does that mean?
Down below is an example of what a proper error handling express route should look like. Notice how the function being passed into app.use method as the second argument has three parameters. This is a standard pattern in express to signify to express two things:
next
, the callback for the route handler, is called by us, the camper-developer extraordinaire, with an argument, an error has occurred and needs to be handled by the error handler down the road.Here are some files where errors are not properly being handled. If you would like to help out respond here with the file that you would like call dibs on.
The text was updated successfully, but these errors were encountered: