Open flisk opened 3 years ago
You probably want to render the nested error here:
https://docs.rs/irc/0.15.0/src/irc/error.rs.html#19-102
The API for this is the second example:
https://docs.rs/thiserror/latest/thiserror/#example
I'm not a maintainer here, but a PR patching this sounds pretty reasonable.
First off, thank you very much for your work on this crate. I've had a lot of fun maintaining my IRC bot written against this library for over a year now.
I'm a little confused about how I can produce meaningful user-facing error messages with 0.15.0. Unfortunately the examples don't seem to shed any light on this.
My application performs reconnect attempts in a loop and reports errors by log, so I'd like to catch any type of error in that loop, report it to the user, and proceed to reconnect. I'm able to obtain an
irc::error::Error
from thefailure::Error
s falling out ofclient.identify()
,stream.next()
and so on, but simply.to_string()
'ing or printing these errors produces very vague results. For example:Debug-formatting produces more useful but less user-friendly output:
I've taken a look at
error.rs
. Is my application supposed to match and implement specific behavior for every error type, or is the vagueness of these error messages unintended?I'd appreciate any pointers.