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

bitkid

05/07/2020, 3:14 PM
Hi! Is there a specific reason why exceptions thrown in
Copy code
call.respondOutputStream{ throw BlaException()}
are not recoverable, meaning that they dont get propagated to the status pages handler?
m

mp

05/07/2020, 3:56 PM
sounds like a bug!
b

bitkid

05/07/2020, 5:31 PM
it could also be a timing problem .. so at the time call.respondOutputStream does something the negotiation is already in progress or something like that
as a workaround i write to an temporary bytearrayoutput stream and then do
Copy code
call.respondOutputStream {
    ByteArrayInputStream(output.toByteArray()).copyTo(this)
}
which is maybe not a good idea because i guess its a blocking operation
2 Views