I try to wrap a fetch api call to a retry policy. As fetch does not throw error on a failed request, I use the result filter. It does work but after the last retry it does not throw the result as an error instead it just returns it. If an error would happen it would have been thrown. I expect that a result that has been identified should be thrown just like an error.
This codesnippet retires failed request as expected but after the last retry returns the result of given request instead of throwing it as an error.
I try to wrap a fetch api call to a retry policy. As fetch does not throw error on a failed request, I use the result filter. It does work but after the last retry it does not throw the result as an error instead it just returns it. If an error would happen it would have been thrown. I expect that a result that has been identified should be thrown just like an error.
This codesnippet retires failed request as expected but after the last retry returns the result of given request instead of throwing it as an error.