https://kotlinlang.org logo
#ktor
Title
# ktor
s

Shan

11/11/2019, 12:11 AM
Has anyone implemented a mp project that handles offline errors/timeout errors (not http status codes) in a result type with Ktor?
j

Jorge R

11/11/2019, 4:09 PM
what do you mean by timeout errors
that is from client, not from server
s

Shan

11/11/2019, 4:43 PM
yes, sorry if it wasn't clear. I meant handling offline/timeout errors in addition to ktor's potential http response errors. it was more of a theoretical question for how one might implement it alongside a result type for http response errors when the offline/timeout errors are specific to each engine. we have our result class for handling response errors already, just wondering if anyone has dealt with offline/timeout in a multiplatform way. I suppose the question doesn't quite fit in the Ktor channel, in retrospect :-)
j

Jorge R

11/12/2019, 7:44 AM
well, I would say offline is a property exclusive for the clients, if a server is offline it is not working 😄
also timeouts (too much time without response, so no response) will be thrown by those clients that are trying to connect somewhere, so only something to deal at client level
I hope this helps
f

Francis Caron

11/12/2019, 9:50 PM
Maybe you already saw it but there is an open issue on this matter. https://github.com/ktorio/ktor/issues/1165