Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document term::emit error cases #140

Open
dtolnay opened this issue Dec 29, 2019 · 2 comments
Open

Document term::emit error cases #140

dtolnay opened this issue Dec 29, 2019 · 2 comments

Comments

@dtolnay
Copy link
Contributor

dtolnay commented Dec 29, 2019

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?

@brendanzab
Copy link
Owner

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.

@Johann150
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants