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 1 commit into from Feb 24, 2018


Copy link

@not-an-aardvark not-an-aardvark commented Feb 23, 2018

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

@@ -0,0 +1,44 @@
Copy link

@ilyavolodin ilyavolodin Feb 24, 2018

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

@not-an-aardvark not-an-aardvark Feb 24, 2018

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
5 checks passed
@not-an-aardvark not-an-aardvark deleted the no-useless-catch branch Feb 24, 2018
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Aug 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants