spierce7
12/24/2019, 5:08 AMOutgoingContent
.
In the below linked code, the exception is happening inside of the func
parameter after it’s been called. My guess is that at that point the return status code has already been chosen, which is too late, and why the exception handlers are ignored.
https://github.com/ScottPierce/kotlin-html/blob/master/kotlin-html-ktor/src/main/kotlin/dev/scottpierce/html/ktor/RespondHtml.kt#L41-L58
The obvious solution is to write to a StringBuilder
, then give the output String
to the ByteWriteChannel
, instead of writing directly to the ByteWriteChannel
.
I thought I’d ask: Is there is a better way I can handle this that I haven’t considered?cy
12/25/2019, 1:27 PM