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

Log as info exceptions from server after sending stop with StopMojo. #9188

Merged
merged 3 commits into from
Jan 25, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,19 @@ private String send(String command, int wait)
}
else
{
//Wait only a small amount of time to ensure TCP has sent the message
s.setSoTimeout(1000);
s.getInputStream().read();
try
{
//Wait only a small amount of time to ensure TCP has sent the message
s.setSoTimeout(1000);
s.getInputStream().read();
}
catch (Exception e)
{
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.");

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.

Copy link
Contributor Author

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?

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!

}
}

return response;
Expand Down