Tips on error handling
I'm currently using OneOf to handle errors.
For example:
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
For example:
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