From 754ccc4197d4581b204644639d5ef1c43fad8f96 Mon Sep 17 00:00:00 2001 From: Koitharu Date: Wed, 18 Dec 2024 16:26:49 +0200 Subject: [PATCH] Added url for NoDataReceivedException --- .../koitharu/kotatsu/core/exceptions/NoDataReceivedException.kt | 2 +- .../main/kotlin/org/koitharu/kotatsu/core/util/ext/Throwable.kt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/core/exceptions/NoDataReceivedException.kt b/app/src/main/kotlin/org/koitharu/kotatsu/core/exceptions/NoDataReceivedException.kt index 3594ce18b..0c1890905 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/core/exceptions/NoDataReceivedException.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/core/exceptions/NoDataReceivedException.kt @@ -3,5 +3,5 @@ package org.koitharu.kotatsu.core.exceptions import okio.IOException class NoDataReceivedException( - url: String, + val url: String, ) : IOException("No data has been received from $url") diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/core/util/ext/Throwable.kt b/app/src/main/kotlin/org/koitharu/kotatsu/core/util/ext/Throwable.kt index a7bae7f51..5811cfa65 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/core/util/ext/Throwable.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/core/util/ext/Throwable.kt @@ -142,6 +142,7 @@ fun Throwable.getCauseUrl(): String? = when (this) { is NotFoundException -> url is TooManyRequestExceptions -> url is CaughtException -> cause?.getCauseUrl() + is NoDataReceivedException -> url is CloudFlareBlockedException -> url is CloudFlareProtectedException -> url is HttpStatusException -> url