You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
res.status(404).send('Could not retrieve the answers.')
Currently 404 catches all errors and only responds if "Something went wrong". Could the types of errors returned be more specific? For example, if parameters are invalid, this should ideally return a different error code than if the parameters were correct but no resource was found (the number isn't in the dataset).
The text was updated successfully, but these errors were encountered:
@trentgoing Hmmm great point. I did see a great pattern in the Mongoose code where each function in the process threw an error with a specific string. That string was then checked with a function to see which error code it was. Once the string was matched, that was the error thrown and sent back to the console. I could implement something like that for this.
QuestAPI/src/server/controllers/answers.js
Line 15 in a1ea73d
Currently 404 catches all errors and only responds if "Something went wrong". Could the types of errors returned be more specific? For example, if parameters are invalid, this should ideally return a different error code than if the parameters were correct but no resource was found (the number isn't in the dataset).
The text was updated successfully, but these errors were encountered: