Remove Exception name from error messages

This commit is contained in:
Kirill Kamakin
2022-12-21 22:39:09 +01:00
parent d74ce4bb2a
commit feb9110f47
2 changed files with 2 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
package gq.kirmanak.mealient.datasource package gq.kirmanak.mealient.datasource
sealed class NetworkError(cause: Throwable) : RuntimeException(cause) { sealed class NetworkError(cause: Throwable) : RuntimeException(cause.message, cause) {
class Unauthorized(cause: Throwable) : NetworkError(cause) class Unauthorized(cause: Throwable) : NetworkError(cause)
class NoServerConnection(cause: Throwable) : NetworkError(cause) class NoServerConnection(cause: Throwable) : NetworkError(cause)
class NotMealie(cause: Throwable) : NetworkError(cause) class NotMealie(cause: Throwable) : NetworkError(cause)

View File

@@ -38,6 +38,6 @@ class BaseUrlInterceptor @Inject constructor(
private fun getBaseUrl() = runBlocking { private fun getBaseUrl() = runBlocking {
val url = serverUrlProvider.getUrl() ?: throw IOException("Base URL is unknown") val url = serverUrlProvider.getUrl() ?: throw IOException("Base URL is unknown")
url.runCatching { toHttpUrl() }.recover { throw IOException(it) }.getOrThrow() url.runCatching { toHttpUrl() }.recover { throw IOException(it.message, it) }.getOrThrow()
} }
} }