chore(error-middleware): allow err.message and err.status values to be used#43
Open
abernier wants to merge 7 commits intoironhack-edu:masterfrom
Open
chore(error-middleware): allow err.message and err.status values to be used#43abernier wants to merge 7 commits intoironhack-edu:masterfrom
abernier wants to merge 7 commits intoironhack-edu:masterfrom
Conversation
ironlauncher with an `n`
… into a utils folder. issue 2: change globally defined �]2;��]1;� variable onto so as not create conflicts with any �]2;��]1;� variable coming from routes. issue 3: rename routes files to add onto file name. issue 4: add cookie-parser onto base express dependencies (ironhack-edu#36)
…-edu#38) Co-authored-by: sandrabosk <sandraboskovic@hotmail.com>
…r-middleware response
Collaborator
|
Interesting, so youre keeping in the error class the status itself? Nice approach! |
Author
|
thank you, yes it avoids having to: res.status(403).json({errorMessage: "forbidden"})👉 which is tedious, and does not take advantage of using the error-middleware, which is here for. On the contrary, we can just call the error-middleware for that with our error, optionally augmented with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.