Back in the day I suggested `withError` , but it d...
# arrow-contributors
c
Back in the day I suggested
withError
, but it doesn't really work with context parameters, since different errors can register different raises. What about:
Copy code
withError({ it: ErrorA -> "Foo $it" }, { it: ErrorB -> "Bar $it" }) {
    // Success code
}
The inner lambda gets
context(Raise<ErrorA>, Raise<ErrorB>)
and all error handlers combine into a single
context(Raise<T>)
(
String
in this example). What do you think?
a
seems interesting, although I'm a bit afraid of all the inference in so many lambdas
😱 1