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
than_
06/06/2023, 10:08 AM
Copy code
getOrElse{ throw it }
than_
06/06/2023, 10:10 AM
That's gonna allow you to use the right type, without needing to unpack/cast it further.