rs-matter icon indicating copy to clipboard operation
rs-matter copied to clipboard

Provide decent error message for wrapped errors

Open ivmarkov opened this issue 1 year ago • 7 comments

Add an error: Box<dyn std::error::Error> member to the Error enum here. Then include the original error message (and possibly its backtrace, if any) in the Debug and Display impl for the matter-rs Error enum.

Just like the backtrace member, it should be enabled only when both std and backtrace features are enabled, as it would be bringing non-trivial cost to the unhappy path.

Yet very useful for proper diagnostics of errors originating outside of matter-rs itself.

ivmarkov avatar Jul 11 '23 07:07 ivmarkov