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

Better errors #226

Closed
bakkot opened this issue Jul 10, 2020 · 1 comment · Fixed by #234
Closed

Better errors #226

bakkot opened this issue Jul 10, 2020 · 1 comment · Fixed by #234

Comments

@bakkot
Copy link
Contributor

bakkot commented Jul 10, 2020

For example, having multiple linebreaks in a <p> should not abort the build with "Error: expecting EOF, got parabreak".

At the very least we need to start wrapping those and providing location information, because the errors at the moment are totally useless. But also we should clean up the output to suggest what's actually wrong. And in the above case it shouldn't be a hard error at all, just a lint warning.

@bakkot
Copy link
Contributor Author

bakkot commented Jul 18, 2020

Thinking about this some: I'd like to use the same format for other errors as we do for linting errors. Those errors are not identified until later in the pipeline. But the eslint error formatters don't support streaming: specifically, they always add a "1 error found." summary at the end, which would be weird to see multiple times. I'm not entirely sure how to handle it. Here's some possibilities, in roughly descending order of how much I like them

  • drop support for arbitrary formatters and reimplement the codeframe formatter
  • drop support for arbitrary formatters and manually modify the output from codeframe to not have the summary
  • support arbitrary formatters but try to tweak their output anyway
  • support arbitrary formatters and just not worry about the confusing output
  • not report any errors until the end of the build, so we can report them all at once

Maybe there's some other alternative?

Edit: went with another alternative, which is to just print errors twice: a quick summary when encountered and, if using --verbose, all the errors together and formatted at the end of the bulid.

This was referenced Jul 22, 2020
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

Successfully merging a pull request may close this issue.

1 participant