Great question!
Handling errors heavily depends on your particular use case. At least I can think of three ways:
just skip the rejected promise and move on
have a predefined amount of attempts before move on
keep trying to fetch a request until success
Here's the simplified example for the 3rd option. I use series helper for simplicity. Fake API request may fail. We keep trying to request API until success.
Great question!
Handling errors heavily depends on your particular use case. At least I can think of three ways:
Here's the simplified example for the 3rd option. I use
series
helper for simplicity. Fake API request may fail. We keep trying to request API until success.And the result is