drewdeponte / git-ps-rs

Official git-ps Rust implementation - the future of git-ps
https://git-ps.sh
MIT License
78 stars 8 forks source link

add source() to all std::error::Error impls so we can get error source chain #265

Closed drewdeponte closed 10 months ago

Alizter commented 10 months ago

Is this something we only want to enable in development mode?

drewdeponte commented 10 months ago

@Alizter No, you want it all the time. It doesn't expose the types. It just exposes a type erased optional source error for each error.

This allows you when an error occurs to understand that, the error happened because of this other error at a lower level, and so forth and so on.

This is crucial from a maintenance standpoint.

Previously I just dumped the errors in debug print which gave me this information. But that isn't very user friendly. Since switching to more user friendly error reporting. If we don't have this then we will have to way to actually help people that run into errors.

drewdeponte commented 10 months ago

This has been integrated into mainline and therefore I am closing this issue.