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
The catch block is just returning the error, but in this way the returning error from the catch will be only handle by the .then.
It would be not better to return a Promise(new Error('caught exception')) as in the then block or just throwing the error return new Error('caught exception') so in this manner it will be handle by the result.catch?
The text was updated successfully, but these errors were encountered:
Hi, on the section about how to handle errors with asynchronous code on the solutions presented is to be consistent and always return something.
The catch block is just returning the error, but in this way the returning error from the catch will be only handle by the .then.
It would be not better to return a
Promise(new Error('caught exception'))
as in the then block or just throwing the errorreturn new Error('caught exception')
so in this manner it will be handle by theresult
.catch?The text was updated successfully, but these errors were encountered: