Sergio C.
10/20/2021, 5:51 PMundermark5
10/20/2021, 9:38 PMIOException
is traditionally thrown with failed blocking IO requests, the linter produces this warning. Because it is simply a warning, you are welcome to ignore assuming you know the risks of such a call, which I believe that in this case, there aren’t any real risks of blocking the current thread as doStuff
should be executed in a different coroutine on a different thread (at least in theory a different thread)ephemient
10/20/2021, 9:56 PMSergio C.
10/20/2021, 9:57 PMIOException
and shows the warning. So if I wrap it with try catch it should go away?Sergio C.
10/20/2021, 9:59 PMephemient
10/20/2021, 9:59 PMSergio C.
10/20/2021, 10:04 PMval json = String(e.response()?.errorBody()?.source()?.readByteArray() ?: byteArrayOf(), StandardCharsets.UTF_8)
readByteArray here shows the same warning. yep it throws IOException
This line is the catching of HttpException from suspend retrofit call. I need to get the response body even if I don't get a 200 OK.Sergio C.
10/20/2021, 10:05 PM