Petter
12/10/2025, 8:36 AMcatch ( { func() }) catch { raise(it) } or is there some other function / syntax I have faield to discoverYoussef Shoaib [MOD]
12/10/2025, 8:39 AMresult { } will turn it into a Result, which you can then bind(). Usually raising Throwable is unusual, though. You likely want to catch a specific exception, and then raise some domain-equivalentYoussef Shoaib [MOD]
12/11/2025, 2:57 PMRaise<Throwable> can be somewhat legitimate when used with withError.
Thinking about it a bit, we should probably add a withException or withCatch or something that takes a reified Throwable type and lets you map it to a raised error. I recall needing something like that before.Youssef Shoaib [MOD]
12/11/2025, 2:59 PMinline fun <reified T: Throwable, Error, R> Raise<Error>.withCatch(transform: (T) -> Error, block: () -> R) = catch(block) { t: T -> raise(transform(t)) }