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

View File

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