the error will be called already before the setTimeout here.

I don't know how to test the error when we're retrying the pending request. Maybe check that it's called twice ?