From 7496f8058b23738c6487c25607ea857d569bdec3 Mon Sep 17 00:00:00 2001 From: Ryan Bogan <10944539+ryanbogan@users.noreply.github.com> Date: Mon, 6 Dec 2021 08:05:28 -0500 Subject: [PATCH] Added more detailed logging for SSLHandshakeException (#1602) * Added more detailed logging for SSLHandshakeException Signed-off-by: Ryan Bogan * Fixed spotless errors for logging change Signed-off-by: Ryan Bogan * Changed message to include original error and limited to specific instance Signed-off-by: Ryan Bogan * Applied troubleshooting message to all instances of SSlHandshakeException Signed-off-by: Ryan Bogan --- .../rest/src/main/java/org/opensearch/client/RestClient.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/rest/src/main/java/org/opensearch/client/RestClient.java b/client/rest/src/main/java/org/opensearch/client/RestClient.java index 4e7cb41ca0227..c004613f89b7f 100644 --- a/client/rest/src/main/java/org/opensearch/client/RestClient.java +++ b/client/rest/src/main/java/org/opensearch/client/RestClient.java @@ -912,7 +912,9 @@ private static Exception extractAndWrapCause(Exception exception) { return e; } if (exception instanceof SSLHandshakeException) { - SSLHandshakeException e = new SSLHandshakeException(exception.getMessage()); + SSLHandshakeException e = new SSLHandshakeException( + exception.getMessage() + "\nSee https://opensearch.org/docs/latest/clients/java-rest-high-level/ for troubleshooting." + ); e.initCause(exception); return e; }