getkyo/kyo

Feature: Add ability to run an Abort with a union of errors

Closed this issue · 0 comments

It is a bit cumbersome running an Abort that has a union. You have to run it repeatedly for each one and then repeatedly flatten the Result. For example:

Abort.run[StatusRuntimeException](Abort.run[StatusException](request)).map(_.flatten)

Abort.run specifically prevents handling multiple errors at once (see the comment on Abortable) so I'm not sure what the solution to this would look like without Tag support. Maybe n overloads of run with increasing number of type parameters (and tediously multiple RunOps too)?