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: avoid useless catch clauses that just rethrow errors #10010

Merged
merged 1 commit into from Feb 24, 2018

Conversation

not-an-aardvark
Copy link
Member

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

[x] Other, please explain:

What changes did you make? (Give an overview)

This commit removes an unnecessary catch clause from the codebase that just rethrows the error. It also adds an internal linting rule to avoid code like that in the future.

Is there anything you'd like reviewers to focus on?

Nothing in particular

@not-an-aardvark not-an-aardvark added the chore This change is not user-facing label Feb 23, 2018
@@ -0,0 +1,44 @@
/**
Copy link
Member

Choose a reason for hiding this comment

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

This feels like it shouldn't be an internal rule. It's useful in general, and not specific to ESLint. Granted, I'm not sure if it's important enough to be in the core, but maybe a separate plugin?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I would be fine with adding it as a core rule. I just made it an internal rule for now so that it doesn't need to wait for approval.

@not-an-aardvark not-an-aardvark merged commit 18e15d9 into master Feb 24, 2018
@not-an-aardvark not-an-aardvark deleted the no-useless-catch branch February 24, 2018 03:44
This was referenced Mar 22, 2018
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Aug 25, 2018
@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 Aug 25, 2018
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants