codespan
codespan copied to clipboard
Document term::emit error cases
In what cases is it possible for https://docs.rs/codespan-reporting/0.6.0/codespan_reporting/term/fn.emit.html to return an error? I see that the error type is std::io::Error; is it guaranteed to be only if a write to the underlying WriteColor fails? Or are there other validations involving the Config / Files / Diagnostic that might trigger an error from term::emit?
Yeah, I agree it's a bit confusing. There are a bunch of expects internally that can trigger if the source ranges and file ids are broken - I would rather those be handled more gracefully.
Since term::emit now returns a Result type since #275, is this still necessary?