From c741bb2eae45093f96b48e1373d52a9eb2c8ee6b Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Wed, 31 Jul 2024 17:22:40 -0500 Subject: [PATCH] Clean up exception messages in SSLSocket --- .../src/main/java/org/mozilla/jss/ssl/SSLSocket.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/base/src/main/java/org/mozilla/jss/ssl/SSLSocket.java b/base/src/main/java/org/mozilla/jss/ssl/SSLSocket.java index 8c036d1e9..427e9fab2 100644 --- a/base/src/main/java/org/mozilla/jss/ssl/SSLSocket.java +++ b/base/src/main/java/org/mozilla/jss/ssl/SSLSocket.java @@ -1507,11 +1507,9 @@ int read(byte[] b, int off, int len) try { iRet = socketRead(b, off, len, base.getTimeout()); } catch (SocketTimeoutException ste) { - throw new SocketTimeoutException( - "SocketTimeoutException cannot read on socket: " + ste); + throw new SocketTimeoutException("Unable to read from socket: " + ste); } catch (IOException ioe) { - throw new IOException( - "SocketException cannot read on socket: " + ioe.getMessage(), ioe); + throw new IOException("Unable to read from socket: " + ioe.getMessage(), ioe); } finally { synchronized (this) { inRead = false; @@ -1534,11 +1532,9 @@ void write(byte[] b, int off, int len) try { socketWrite(b, off, len, base.getTimeout()); } catch (SocketTimeoutException ste) { - throw new SocketTimeoutException( - "SocketTimeoutException cannot write on socket: " + ste); + throw new SocketTimeoutException("Unable to write to socket: " + ste); } catch (IOException ioe) { - throw new IOException( - "SocketException cannot write on socket: " + ioe.getMessage(), ioe); + throw new IOException("Unable to write to socket: " + ioe.getMessage(), ioe); } finally { synchronized (this) { inWrite = false;