Tips on error handling

I'm currently using OneOf to handle errors.

For example:

public async Task<OneOf<None, NotFound, List<ValidationFailure>, GenericError>> EditOrderItem(Guid uid, EditOrderItemOptions options)

However that is kinda of mouthful. I could try to refactor it using OneOfBase, but there are cases where I need <None, NotFound> or <None, NotFound, GenericError> or really any combination...

Is there any way I can refactor it?
I'd like to avoid exceptions as this would migrate the problem to "try-catching" everything then `if - is" on the exceptions
Was this page helpful?