phldavies
03/03/2025, 10:33 AMAlejandro Serrano.Mena
03/03/2025, 11:21 AMAlejandro Serrano.Mena
03/03/2025, 11:22 AMphldavies
03/03/2025, 11:41 AMcall.pathOrRaise(name)
from a context in which you have a Raise<Response>
or Raise<RequestError>
, rather than from within a handleOrRaise
or respondOrRaise
block which uses a RaiseRoutingContext
intersection type as receiver).
It might be worth removing the context receiver usage for now until 2.2 when we can start adding context-parameters cleanly.simon.vergauwen
03/04/2025, 9:14 AMRaiseAccumulate
which would suffer a small binary/source breakage (additional imports).phldavies
03/04/2025, 9:59 AMsimon.vergauwen
03/04/2025, 10:19 AMphldavies
03/04/2025, 10:21 AMcontext(raise: Raise<String>)
inline val RoutingContext.pathRaising get() = Provider { call.pathParameters[it] ?: raise.raise("missing '$it'") }
context(raise: Raise<String>)
inline fun <reified T: Any> RoutingContext.pathRaising() = Provider { catch({call.pathParameters.getOrFail<T>(it)}, { raise.raise(it.toString()) }) }
context(raise: Raise<String>)
inline fun <T: Any> RoutingContext.pathRaising(crossinline transform: Raise<String>.(String) -> T) = Provider { raise.transform(call.pathParameters[it] ?: raise.raise("missing '$it'")) }
phldavies
03/04/2025, 10:22 AMget("/") {
either {
val value by pathRaising
val intValue: Int by pathRaising()
val alsoIntValue by pathRaising<Int>()
val customConvert by pathRaising { it.uppercase() }
}
}
phldavies
03/04/2025, 10:30 AMAlejandro Serrano.Mena
03/04/2025, 1:08 PMAlejandro Serrano.Mena
03/04/2025, 1:08 PMphldavies
03/04/2025, 2:17 PMphldavies
03/04/2025, 3:12 PMsuspendapp
can likely follow the usual arrow versioning, but I've backported the jvm-deadlock fix to the old repo (https://github.com/arrow-kt/suspendapp/pull/144) if we wanted to push a 0.5.1 out - I intend to keep that PR uptodate with the elected fix from the arrow repo. This would at least allow a faster fix for the jvm bug to be available prior to arrow 2.1 release of suspendapp.
suspendapp-ktor
may not need separate versioning as it shouldn't need breaking changes too often
for the new ktor-raise-api, separate versioning for initial release would be good and allow for faster iteration - it could be aligned later or not (so long as it doesn't go above arrow's versioning)simon.vergauwen
03/05/2025, 7:16 AM