We've been advised by the UMAPI/JIL team that the API gateway will sometimes refuse connections. The UMAPI client should treat these connection errors like a timeout and wait a random amount of time and try again with exponential backoff.
I've refactored the API response handling logic so that a response from the requests call is wrapped in an APIResult object which provides which checks the response for a retry timestamp or delta. It also checks for certain response codes that represent fatal errors. In the cases of request.Timeout and request.ConnectionError errors, we can construct an APIResult object with no underlying response so the timeout logic will handle those cases.
We've been advised by the UMAPI/JIL team that the API gateway will sometimes refuse connections. The UMAPI client should treat these connection errors like a timeout and wait a random amount of time and try again with exponential backoff.
I've refactored the API response handling logic so that a response from the
requests
call is wrapped in anAPIResult
object which provides which checks the response for a retry timestamp or delta. It also checks for certain response codes that represent fatal errors. In the cases ofrequest.Timeout
andrequest.ConnectionError
errors, we can construct anAPIResult
object with no underlying response so the timeout logic will handle those cases.