ApiError.response is None if no internet connection
robmarkcole opened this issue · comments
An ApiError
is thrown if the internet connection is unavailable, but ApiError.response
is None
in this case. Please could it be handled explicitly
@robmarkcole Yeah, a fix was just released yesterday in 2.4.2, please upgrade.
Ignore above, I see what you're saying.
In that case the response is None because on unavailable internet connection, no response has been received. The response object is instantiated and contains error fields when an error response is actually received.
Will this behaviour be changed in an upcoming release?
@robmarkcole There is no immediate plan of changing this behavior. I would like to make new classes that extend ApiError
such as TimeoutApiError
and FailureResponseApiError
etc. but this is something we have to think about.