codespan icon indicating copy to clipboard operation
codespan copied to clipboard

Document term::emit error cases

Open dtolnay opened this issue 5 years ago • 2 comments

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?

dtolnay avatar Dec 29 '19 04:12 dtolnay

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.

brendanzab avatar Mar 03 '20 04:03 brendanzab

Since term::emit now returns a Result type since #275, is this still necessary?

Johann150 avatar Sep 17 '20 17:09 Johann150