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

hhariri

12/01/2021, 3:09 PM
📣 Folks, would appreciate your feedback on this! https://twitter.com/JetBrainsKtor/status/1466061672481796103 📣
👍 1
t

Trevor Stone

12/01/2021, 3:12 PM
Can you share insight into the current debate for why some feel it's worth changing?
b

Big Chungus

12/01/2021, 3:18 PM
I'd like to keep exceptions for client calls that are returning extracted and deserialized response body, but not to throw exceptions when returning some abstraction container over http response (with headers, body, response code and other metadata)
5
h

hhariri

12/01/2021, 3:22 PM
@Trevor Stone we observe a good number of users setting this value to False (i.e. changing the default). This is based on internal usage at JetBrains as well as the occasional code we see in samples, etc. And also a few of us on the team kind of feel like anything outside of 2XX is still a valid status code so shouldn’t be treated as an exception (which is really for exceptional cases).
h

Hasan Hosgel (alosdev)

12/01/2021, 3:27 PM
I always set if to false, because not having 200 is not a runtime error it is an expected one if you use http status codes.
👍🏾 1
👍🏼 2
👍 8
b

Big Chungus

12/01/2021, 3:29 PM
If only kotlin would have a distinction between the two. Almost like it needs "checked" exceptions 🧌
To be clear, I'm not a fan of checked exceptions.
p

Peter

12/01/2021, 4:21 PM
+1 for no exceptions, especially not if the remote server returned a response of any kind saves me from having to wrap those exceptions myself 😄
d

Dominaezzz

12/01/2021, 7:01 PM
+1 for no exceptions, I always turn them off.
j

Javier

12/01/2021, 7:17 PM
No exceptions, indeed I have adapters for both, retrofit and ktor returning an
Either<SomeError, SomeSuccess>
4
where
SomeError
is not an exception, is my own error class
z

zpearce

12/01/2021, 8:20 PM
+1 for defaulting to not throwing