Client doesn't throw for HTTP Errors when Any
is the expected result.
#1209
Labels
ux
User Experience issue
Any
is the expected result.
#1209
Ktor Version
1.2.2
Ktor Engine Used(client or server and name)
Client w/ OkHTTP Engine on Android
JVM Version, Operating System and Relevant Context
IntelliJ IDEA 2019.1.3 (Ultimate Edition)
Build #IU-191.7479.19, built on May 28, 2019
JRE: 1.8.0_202-release-1483-b58 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.5
Feedback
With the above code, we found that our app doesn't throw http exceptions, which was a bit unexpected, and took a bit of debugging.
result
ends up being aDelegatedResponse
, and is thus expecting us to handle the http value ourselves, which was again, unexpected.This code was something we didn't care about the response, and so someone who didn't know what they were doing defaulted it to type
Any
.Instead of unexpectedly returning a
DelegatedResponse
object, and expecting the caller to handle the error handling, it'd probably be better to throw aRuntimeException
mentioning this isn't an allowed response type, so that unexpected bugs like this don't happen.The text was updated successfully, but these errors were encountered: