-
Notifications
You must be signed in to change notification settings - Fork 41.7k
Remove unreachable throw code #39107
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
Remove unreachable throw code #39107
Conversation
wilkinsona
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Unfortunately, this isn't the change that we want to make. As described in the issue, we want to change handleRunFailure to return the exception and to then have it thrown by the caller. This will eliminate the dead code while continuing to make it clear that the method won't continue to execute.
|
Hi @wilkinsona, |
Said method returns the exception wrapped as IllegalStateException if necessary. The if-statements for handling different exceptions use dedicated catch-blocks. Fix spring-projectsgh-39086
109ba58 to
5132ff4
Compare
|
Hi @wilkinsona, P.S. I was not sure, if |
Improve `SpringApplication` by removing the unreachable throw statement in favor of returning an exception from `handleRunFailure`. This commit also removes the if statements in favor of dedicated catch blocks. See gh-39107
|
Thanks very much @BenchmarkingBuffalo. I made one further tweak by pushing the |
Remove the dead code after calling 'handleRunFailure'.
No adjustment of tests needed.
Fix #39086