slog icon indicating copy to clipboard operation
slog copied to clipboard

Add support for `dyn Error` references

Open demurgos opened this issue 1 year ago • 2 comments

The PR https://github.com/slog-rs/slog/pull/327 adds support for error references. Unfortunately it's missing support for dyn Error. Error trait objects are fairly common so it's unfortunate that it's not supported, we should try to add support for it.

demurgos avatar Jan 03 '24 12:01 demurgos

As far as I know, using an owned trait object (Box<dyn Error>) should work fine with the existing ErrorValue. The only problem is using a borrowed &dyn Error with the new ErrorRef.

Please let me know if this is incorrect.

Techcable avatar Jan 04 '24 03:01 Techcable