Remove Exception name from error messages
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
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 NoServerConnection(cause: Throwable) : NetworkError(cause)
|
||||
class NotMealie(cause: Throwable) : NetworkError(cause)
|
||||
|
||||
@@ -38,6 +38,6 @@ 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) }.getOrThrow()
|
||||
url.runCatching { toHttpUrl() }.recover { throw IOException(it.message, it) }.getOrThrow()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user