Best practice: Nested underying errors or error mapping, or something I haven't thought about?

I'm a big fan of the Result type. I like to add the extra information of typed errors.

But when I rely on other code with local error types I often experience the choice between either mapping the errors of the underlying code to local errors, or wrapping them in a nested error case like .underlyingError(Error).

I have a feeling that there's some other solution I haven't thought about or understood.

1 Like
Terms of Service

Privacy Policy

Cookie Policy