diff --git a/datasource/src/main/kotlin/gq/kirmanak/mealient/datasource/impl/BaseUrlInterceptor.kt b/datasource/src/main/kotlin/gq/kirmanak/mealient/datasource/impl/BaseUrlInterceptor.kt index 8796804..ad00f26 100644 --- a/datasource/src/main/kotlin/gq/kirmanak/mealient/datasource/impl/BaseUrlInterceptor.kt +++ b/datasource/src/main/kotlin/gq/kirmanak/mealient/datasource/impl/BaseUrlInterceptor.kt @@ -38,6 +38,11 @@ class BaseUrlInterceptor @Inject constructor( private fun getBaseUrl() = runBlocking { val url = serverUrlProvider.getUrl() ?: throw IOException("Base URL is unknown") - url.runCatching { toHttpUrl() }.recover { throw IOException(it.message, it) }.getOrThrow() + url.runCatching { + toHttpUrl() + }.fold( + onSuccess = { it }, + onFailure = { throw IOException(it.message, it) }, + ) } } \ No newline at end of file