https://kotlinlang.org logo
#arrow
Title
# arrow
c

CLOVIS

03/30/2024, 10:57 AM
I have a few helpers for using Raise with Ktor… should I open source them, or is there already something public to do this?
p

phldavies

03/30/2024, 2:42 PM
I have a similar
respond
helper that operates on
Raise<OutgoingContent>.() -> R
. Where it will respond with the conputation result with status 200 (or an overridden status)
❤️ 1
Might be nice to have an override that works over
Raise<E>
given a mapping
(E) -> OutgoingContent
c

CLOVIS

03/30/2024, 5:09 PM
There is
withError
for that
d

dave08

03/31/2024, 11:52 AM
Why not just combine the parsing/retrieving with the ensure? That way you save extra lines... also the error type could be derived with an inline fun and reified types and there could be a default error returned that can be modified if needed...