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
@jackherizsmith Ideally you should have a catch somewhere in the chain. If the db query returns a resolved/rejected promise to somewhere else, you can put the catch there(in the handler) to make the error handling a server response.
So queries themselves can be left without cstches, just return the promise in its final state, and then you can propagate all errors up to the handler level and .catch() there
week7-hihi/handlers/users-handler.js
Lines 60 to 77 in 68325ba
again, hard to keep track of due to nested brackets, but its a case of a missing .catch()
you're catching junctionModel.getUserFromBook, but before that there's booksModel.getIdFromTitle which will throw an exception when theres an error.
adding .catch(next) on line 77 should do the trick.
btw, absolutely brilliant naming for your model functions!
The text was updated successfully, but these errors were encountered: