-
Notifications
You must be signed in to change notification settings - Fork 6
Description
It's quite a common pattern (I think!) in throwaway scripts and example code at least (and I use it quite often just to play around with ideas) for a top-level main to return something like Result<(), Box<dyn Error>> - any normal errors can be converted to that, and it means you can have all kinds of different error-producing code called in your top-level main without having to worry about all of the errors converging to a concrete return type. However, that doesn't seem possible at the moment with exn - Exn<T> where T: Error doesn't have that conversion built in, and there's no simple way to fix that as a library user because of the orphan rule.
Would it be possible to address this in some way? I get that the general approach is to treat each module as an error boundary, but when you've got some experimental code calling all kinds of different parts of a codebase, having to .or_raise(...)? every function which was just ? in previous approaches is a bit of a pain for simple but rapidly changing code.