It'd be convenient if a callback could be registered with color_eyre::config::HookBuilder that gets called with the error passed to the EyreHandler and can add sections to the returned Report.
My use case is annotating 3rd party errors with additional info by downcasting them from the std::error::Error reference. For example, I could create a section with the url, status, and body from a reqwest::Error without having to annotate every single place where the conversion happens.
I could potentially do this by wrapping the color_eyre::config::EyreHook returned by the HookBuilder but it's limited to writing some text before and/or after the call to Handler.debug/display, which isn't pretty.
It'd be convenient if a callback could be registered with
color_eyre::config::HookBuilder
that gets called with the error passed to theEyreHandler
and can add sections to the returnedReport
.My use case is annotating 3rd party errors with additional info by downcasting them from the
std::error::Error
reference. For example, I could create a section with the url, status, and body from areqwest::Error
without having to annotate every single place where the conversion happens.I could potentially do this by wrapping the
color_eyre::config::EyreHook
returned by theHookBuilder
but it's limited to writing some text before and/or after the call toHandler.debug/display
, which isn't pretty.