-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Log as info exceptions from server after sending stop with StopMojo. #9188
Conversation
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.
I would catch (Throwable)
like we do elsewhere, but besides that LGTM.
I might go the other direction and only |
@gsf-sellis there's not much the plugin can do if there's any kind of exception thrown after we've sent the |
I'm just thinking in terms of keeping the catch block specific to the case that we know is harmless and that we can recover from. Anything else would be uncaught, propagated up the stack, and logged at a higher level than |
Oops I'm realizing now that I was hoping to maybe hide this error at the One option might be to |
How about this: if |
That sounds great, thanks! |
if (getLog().isDebugEnabled()) | ||
getLog().error("Error after sending command: " + command + ". Check the server state.", e); | ||
else | ||
getLog().info("Error after sending command: " + command + ". Check the server state."); |
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.
Maybe "Error" could be e.getMessage()
? It's probably SocketException: Connection reset
but could be something else.
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.
OK, how about the latest commit then?
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.
Looks great! It's too bad we have to work around Windows TCP issues like this but it will be a quality of life improvement for me and others. Thanks!
Closes #9129
Catch and log at info level any exceptions from server after jetty StopMojo sends stop command.