OptionalmaxOptionalonfunction that will be called if an error is thrown while calling the rest of the middleware chain, and should return whether the error should be retried
Optionalonfunction that will be called whenever a response is received, and should return whether the response is valid (i.e. should be returned and not retried)
Optionalonfunction that will be called before a retry is attempted, and can be used to modify the request before proceeding
current retry attempt (starts at 0)
Optionalretrydelay between retries
Optionalreturnif true, the last response will be returned if the number of retries is exceeded instead of throwing RetriesExceededError
Optionalskipfunction that will be called before starting the retry loop. if it returns false, the retry loop will be skipped and the error will be thrown immediately
max number of retries