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

do not catch checked Exception if is not thrown #2615

Merged

Conversation

bokshitsky
Copy link
Contributor

@bokshitsky bokshitsky commented Aug 4, 2021

non significant update - tried to put it in previous pr #2612 but you suggested to put in separate

catching checked Exception instead of RuntimeException should be a avoided: it is dangerous due to code inside try block may add new checked exception with special handling required, but author can miss it due to no compile error (especially dangerous for InterruptedException)

commit modifies all production files with this "code smell", do not touch tests files due to less dangerous consequences of possible error in them.

@bokshitsky bokshitsky closed this Aug 5, 2021
@sazzad16
Copy link
Collaborator

sazzad16 commented Aug 7, 2021

@bokshitsky any reason for closing this?

ps: tests are now passing.

@bokshitsky
Copy link
Contributor Author

Ouch.

Had problems with local tests run - sentinel tests were falling - I though what my branch was not the reason.
But when I saw CI test falling I decided that I really broke something and was going to fix latter:)

Thanks, reopen the PR

@bokshitsky bokshitsky reopened this Aug 7, 2021
@bokshitsky
Copy link
Contributor Author

@sazzad16 what do you think about these changes?

image

@sazzad16
Copy link
Collaborator

@bokshitsky My comment about these changes in #2612 still stands. (PS: I get your concern as well.) So I'm just waiting for other reviewers to participate.

dengliming
dengliming previously approved these changes Aug 24, 2021
gkorland
gkorland previously approved these changes Aug 26, 2021
@sazzad16 sazzad16 added this to the 3.8.0 milestone Aug 26, 2021
@sazzad16 sazzad16 dismissed stale reviews from gkorland and dengliming via 2f753aa August 26, 2021 14:04
@sazzad16 sazzad16 merged commit 211d903 into redis:master Sep 30, 2021
sazzad16 added a commit that referenced this pull request Sep 30, 2021
* do not catch checked Exception if is not thrown

* format import

Co-authored-by: Guy Korland <gkorland@gmail.com>
Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>
@chayim chayim mentioned this pull request Jun 2, 2022
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 this pull request may close these issues.

None yet

4 participants