Familiar with OkHttp and retrofit, I tried to give...
# ktor
l
Familiar with OkHttp and retrofit, I tried to give ktor client a try but I'm now giving up for the following reasons: 1. I failed to find how to find out what kind of `Throwable`s an http call can throw (for Retrofit, it's HttpException, IOException, and RuntimeException from custom converters, interceptors or authenticator), which is a big deal as I don't want to show "unknown error" to the user and be clueless as to the call failure root cause. 2. I didn't find how I can set a pipeline "middleware" that can detect some errors (like HTTP 401), do an operation (e.g. attempt to refresh the token), and then retry the call without the initial caller having to retry. I mean, unless I do it using OkHttp authenticator, but that forces me to stick to the OkHttp engine while I wanted to try
CIO
, and going multiplatform. It seems to me that ktor sever doc got a lot more love than ktor client. If that's really the case, is reducing that imbalance planned?
❤️ 2
l
Oh, I didn't know you could implement your own AuthProvider. Submitted a PR in the docs for that: https://github.com/ktorio/ktorio.github.io/pull/273
👍 2
e
100% agreed that the server docs are better than the client docs. I eventually got my client impl working but it took longer than it should’ve