If I have: ```either { val id = ... // raises i...
# arrow
d
If I have:
Copy code
either {
   val id = ... // raises if not found

   // a bunch of operations that can raise
}
And I need to record any failures in the other operations with the id in the first step, do I really need a nested either to do that?
c
You can use
withErrors
to map failures:
Copy code
either {
    val id = …

    withErrors({ it.withId(id) }) {
        // a bunch of operations that can raise
    }
}
❤️ 2
👍🏼 1
s
That's a really neat tricky with
withErrors
actually 😍
Should we start a cookbook somewhere, would be great to have on the website if it contains "enough" recipes.
👀 3