Best practices for narrowing down errors for specific treatment
What would be the best practice for differentiating between different error types in order to e.g. build a corresponding retry?
In https://gist.github.com/mikearnaldi/4a13fe6f51b28ad0b07fd7bbe3f4c49a we can see
Based on:
How would I adapt that to e.g. only retry in case of a more specific HttpError, e.g. 429? Would I rather adapt the fetch to throw more specific errors, or adapt the HttpError to somehow contain the status code and adapt the retry schedule based on that status code?
In https://gist.github.com/mikearnaldi/4a13fe6f51b28ad0b07fd7bbe3f4c49a we can see
Based on:
How would I adapt that to e.g. only retry in case of a more specific HttpError, e.g. 429? Would I rather adapt the fetch to throw more specific errors, or adapt the HttpError to somehow contain the status code and adapt the retry schedule based on that status code?
Gist
Generic batching & retries. GitHub Gist: instantly share code, notes, and snippets.
