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

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 @@
/**

This comment has been minimized.

Copy link
@ilyavolodin

ilyavolodin Feb 24, 2018

Member

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?

This comment has been minimized.

Copy link
@not-an-aardvark

not-an-aardvark Feb 24, 2018

Author Member

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
5 checks passed
commit-message Commit message follows guidelines
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details
release-monitor No patch release is pending
Details
@not-an-aardvark not-an-aardvark deleted the no-useless-catch branch Feb 24, 2018
This was referenced Mar 22, 2018
@renovate renovate bot mentioned this pull request Mar 23, 2018
@eslint eslint 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.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.