Return the actual error body as a string (#3440)
The previous code returned the text representation of the error body type, which resulted in errors appearing in the UI as: ``` okhttp3.ResponseBody$Companion$asResponseBody$1@... ``` This code actually converts the *body* of the error response to a string, so the error is displayed correctly.
This commit is contained in:
parent
51be2c9374
commit
9ec9d35100
|
@ -58,7 +58,7 @@ class NotificationsPagingSource @Inject constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!response.isSuccessful) {
|
if (!response.isSuccessful) {
|
||||||
return LoadResult.Error(Throwable(response.errorBody().toString()))
|
return LoadResult.Error(Throwable(response.errorBody()?.string()))
|
||||||
}
|
}
|
||||||
|
|
||||||
val links = getPageLinks(response.headers()["link"])
|
val links = getPageLinks(response.headers()["link"])
|
||||||
|
|
Loading…
Reference in New Issue