I can use the coroutines of Kotlin with Retrofit. But I get a warning in Android Studio when I try to deserialize the error body.
This is the warning: "Warning:(38, 51) Inappropriate blocking method call"
This is the code:
override suspend fun checkCredentials(email: String, password: String): AuthorizedUser {
val response = authService.signIn(User(email, password)).awaitResponse()
if (response.isSuccessful) {
......
} else {
val errorBody = response.errorBody()?.string() //Warning
....
}
}
The error body is always buffered so this is a false positive. I suspect the inspection isn't smart enough to understand that, it seems to false positive quite a lot
Most helpful comment
The error body is always buffered so this is a false positive. I suspect the inspection isn't smart enough to understand that, it seems to false positive quite a lot