Hey, if I wanted to override the exception from kt...
# ktor
s
Hey, if I wanted to override the exception from ktor for BadResponseStatus and turn it into a different exception, can I do that in a ktor feature?
1
e
You could disable
ExpectSuccess
feature as workaround. Probably it could be disabled by default
Copy code
HttpClient {
    expectSuccess = false
}
e
And after disabling it you could add your own
ExpectSuccess
with witch you intercept the response and throw your own exceptions. See the kotlinconf app: https://github.com/JetBrains/kotlinconf-app/blob/master/common/src/commonMain/kotlin/org/jetbrains/kotlinconf/api/ExpectSuccess.kt#L17
👍 1
s
I'll try this
My exception gets turned into a
ReceivePipelineException
Only
BadResponseStatusException
is allowed out.