Of course, the save() error might be a networking error, whereas the handleSuccess() error may be because the developer forgot to handle a specific status code. What if you want to handle them differently? You could opt to handle them both:
A promise is an object that may produce a single value some time in the future: either a resolved value, or a reason that it’s not resolved (e.g., a network error occurred). A pr…
… promise rejection. It’s a good idea to always handle promise rej… promise rejection. It’s a good idea to always handle promise rejections, even if your handler is a noop().
… promise rejection