Parsing the string message seems bad. Or was this exception not meant to be caught?
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:21)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to catch the
IOExceptionand, yes, parse the string.There isn’t any other exception more specific than that to be caught as far as I know.
Or catch
SocketExceptionand, again, parse the string.Here‘s the class tree from javadoc (version 6). As you can see,
SocketExceptionis the most specialized exception to be thrown when the connection is reset.