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

Chore: improve crash reporting (fixes #11304) #11463

Merged
merged 1 commit into from Mar 15, 2019

Conversation

alexzherdev
Copy link

@alexzherdev alexzherdev commented Mar 2, 2019

Add source file name and line number to the output in the event of a rule crash

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[x] Other, please explain:

See #11304.

What changes did you make? (Give an overview)
Added file name and line information to the error being thrown. This will get output independent of the verbosity setting.

Is there anything you'd like reviewers to focus on?
Not sure about the exact output format, made a best guess.

Add line number to the output in the event of a rule crash
@jsf-clabot
Copy link

jsf-clabot commented Mar 2, 2019

CLA assistant check
All committers have signed the CLA.

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Mar 2, 2019
@aladdin-add aladdin-add added enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion chore This change is not user-facing and removed triage An ESLint team member will look at this issue soon labels Mar 2, 2019
Copy link
Member

@not-an-aardvark not-an-aardvark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

debug("An error occurred while traversing");
debug("Filename:", options.filename);
if (err.currentNode) {
const { line } = err.currentNode.loc.start;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get column information here too?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could. The reason I didn't include it is because it's even less accurate than the line number - it won't always point exactly to the spot that caused the crash. Even the line number won't always do that, depending on how the rule is implemented.

Copy link
Member

@btmills btmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for improving this!

@btmills btmills merged commit 448e8da into eslint:master Mar 15, 2019
@alexzherdev alexzherdev deleted the 11304-crash-reporting branch March 15, 2019 17:32
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Sep 12, 2019
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion chore This change is not user-facing enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants