This repository has been archived by the owner on May 6, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Retrofit call cancellation triggering error
OkHttp throws a standard IOException with the message "Canceled" whenever any call is cancelled, which is passed on by the base ErrorHandlingCallback implementation to the ErrorUtils.getErrorMessage() method, which in turn interprets it as a network connectivity issue, and returns the appropriate error message. This commit fixes the issue by adding a check in the ErrorHandlingCallback implementation’s failure callback to verify that the call hasn’t been cancelled, before delivering the error message.
- Loading branch information