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

Print multi-line errors on their own lines in Report #435

Open
judemille opened this issue Jan 12, 2024 · 2 comments
Open

Print multi-line errors on their own lines in Report #435

judemille opened this issue Jan 12, 2024 · 2 comments

Comments

@judemille
Copy link

I've run into a funny problem -- ParseErrors from winnow get displayed on multiple lines. If, for example, the first line contains a line that has an error in it, and then the second line contains a caret pointing to the text, the current Display impl on Report will mess that up.

Fixing this should be simple -- I can probably implement it fairly easily after some discussion on how best to go about fixing it. I figure the best solution is to break multi-line errors onto their own lines, and then add a line or two of padding after, before displaying the next error.

@shepmaster
Copy link
Owner

Can you show what their error looks like when formatted by itself and then what it looks like from Report?

@judemille
Copy link
Author

judemille commented Jan 14, 2024

Here is an example where I send the error through .map_err(|e| { eprintln!("parse error:\n\n{}\n\n", e.cause().unwrap()); e }):

The first output is my map_err, the second is the Report.
image

The faulty column is SIDBY___.

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

2 participants