Restore previous log when a request fails

This commit is contained in:
Benoit Marty 2021-04-07 10:55:43 +02:00 committed by Benoit Marty
parent 0a0e3c3319
commit 3a81521eab
1 changed files with 7 additions and 3 deletions

View File

@ -55,9 +55,13 @@ internal suspend inline fun <DATA> executeRequest(globalErrorReceiver: GlobalErr
else -> throwable
}
// Log some details about the request which has failed. This is less useful than before...
// Timber.e("Exception when executing request ${apiCall.request().method} ${apiCall.request().url.toString().substringBefore("?")}")
// Log some details about the request which has failed.
val request = (throwable as? HttpException)?.response()?.raw()?.request
if (request == null) {
Timber.e("Exception when executing request")
} else {
Timber.e("Exception when executing request ${request.method} ${request.url.toString().substringBefore("?")}")
}
// Check if this is a certificateException
CertUtil.getCertificateException(exception)