forked from github/szkolny
[Errors] Fix Timeout error detection (SocketTimeoutException inherits from InterruptedIOException).
This commit is contained in:
parent
3ae8100bda
commit
40acb67ceb
@ -366,8 +366,8 @@ abstract class Data(val app: App, val profile: Profile?, val loginStore: LoginSt
|
|||||||
apiError.errorCode = when (apiError.throwable) {
|
apiError.errorCode = when (apiError.throwable) {
|
||||||
is UnknownHostException -> ERROR_REQUEST_FAILURE_HOSTNAME_NOT_FOUND
|
is UnknownHostException -> ERROR_REQUEST_FAILURE_HOSTNAME_NOT_FOUND
|
||||||
is SSLException -> ERROR_REQUEST_FAILURE_SSL_ERROR
|
is SSLException -> ERROR_REQUEST_FAILURE_SSL_ERROR
|
||||||
is InterruptedIOException, is ConnectException -> ERROR_REQUEST_FAILURE_NO_INTERNET
|
|
||||||
is SocketTimeoutException -> ERROR_REQUEST_FAILURE_TIMEOUT
|
is SocketTimeoutException -> ERROR_REQUEST_FAILURE_TIMEOUT
|
||||||
|
is InterruptedIOException, is ConnectException -> ERROR_REQUEST_FAILURE_NO_INTERNET
|
||||||
else ->
|
else ->
|
||||||
if (apiError.errorCode == ERROR_REQUEST_FAILURE)
|
if (apiError.errorCode == ERROR_REQUEST_FAILURE)
|
||||||
when (apiError.response?.code()) {
|
when (apiError.response?.code()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user