What is the canonical way to deal with an either w...
# arrow
d
What is the canonical way to deal with an either where you want to throw a wrapped version of the exception (which in my case means Spring's exception handler will convert it to a response) or use the actual return value. I found fold with ifLeft and ifRight, but also getOrElse
t
Copy code
getOrElse{ throw it }
That's gonna allow you to use the right type, without needing to unpack/cast it further.
h