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

Avoid assertion in finally block #235

Merged
merged 1 commit into from
Jan 30, 2023
Merged

Conversation

exoego
Copy link
Contributor

@exoego exoego commented Jan 29, 2023

This is an issue found while working in #232.

Assertion in finally block is generally a not good idea.
Because it hides the real exception thrown in try block and makes debugging hard.

try {
  doSomething();   // unexpected exception thrown
  assertThat(...);
} finally {
  assertThat(...); // AssertionError is thrown, which hides the exception thrown from try block
}

@exoego exoego added the chore internal changes (not user-facing) label Jan 29, 2023
@exoego exoego marked this pull request as ready for review January 29, 2023 04:58
@exoego exoego merged commit 1ffa62b into master Jan 30, 2023
@exoego exoego deleted the avoid-assertion-in-finally branch January 30, 2023 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore internal changes (not user-facing)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants