This crate is nice to have for debugging. Thank you for writing it.
I just had the case already over the past decades where everyone wants to turn every error into Java backtraces (even when not in Java ;) ) and want to emphasize that this is almost never what one should do in regular operation.
As you said, unwrap() and expect() and panic!() do that for the "definitely a bug" case already. And, there, it's correct.
>probably most times want to let the "user" (the developer using the library) decide what course of action to take, based on the error.
I agree.
>But maybe the user wants to file a bug report, and then it would be helpful to know the file and line information.
In my opinion this belongs in the debug information (i.e. dwarf or similar) then. You can also store dwarf debug info outside of the object file.
>> What about all the other places where everything went right? Wanna log those, too? :)
>If everything went right, the Ok(val) is simply returned as Ok(val) unchanged, see `wherr/src/lib.rs`: match result { Ok(val) => Ok(val), ...
I see. But what I meant is that if the Err case of a regular Result value is enriched like this, why not the Ok case? After all, the programmer (user of your crate) could have erroneously returned Ok where they should have returned Err. Would only be consistent.
I know that that isn't easily possible there. That brings me back to "all result::Result construction sites should show up in dwarf debug info".
I use debuggers less than I should. But thinking about it that's silly. We should be able to use debuggers to debug problems, including problems like this.