diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/network/Request.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/network/Request.kt index d9f102c7e0..e39bce6c67 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/network/Request.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/network/Request.kt @@ -55,9 +55,13 @@ internal suspend inline fun 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("?")}") - Timber.e("Exception when executing request") + // 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)