From: Jim Procter Date: Mon, 20 Sep 2021 13:54:50 +0000 (+0100) Subject: JAL-3829 throw the exception even if it has no message X-Git-Tag: Release_2_11_2_0~34^2~3^2~7 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=f79d77578e9fe54f5e9c910f6563c71beaaf088b;p=jalview.git JAL-3829 throw the exception even if it has no message --- diff --git a/src/jalview/fts/service/threedbeacons/TDBeaconsFTSRestClient.java b/src/jalview/fts/service/threedbeacons/TDBeaconsFTSRestClient.java index 08edcdf..c05306a 100644 --- a/src/jalview/fts/service/threedbeacons/TDBeaconsFTSRestClient.java +++ b/src/jalview/fts/service/threedbeacons/TDBeaconsFTSRestClient.java @@ -127,22 +127,23 @@ public class TDBeaconsFTSRestClient extends FTSRestClient } catch (Exception e) { String exceptionMsg = e.getMessage(); - if (exceptionMsg.contains("SocketException")) + if (exceptionMsg != null) { - // No internet connection - throw new Exception(MessageManager.getString( - "exception.unable_to_detect_internet_connection")); - } - else if (exceptionMsg.contains("UnknownHostException")) - { - // The server is unreachable - throw new Exception(MessageManager.formatMessage( - "exception.fts_server_unreachable", "3DB Hub")); - } - else - { - throw e; + if (exceptionMsg.contains("SocketException")) + { + // No internet connection + throw new Exception(MessageManager.getString( + "exception.unable_to_detect_internet_connection")); + } + else if (exceptionMsg.contains("UnknownHostException")) + { + // The server is unreachable + throw new Exception(MessageManager.formatMessage( + "exception.fts_server_unreachable", "3DB Hub")); + } } + throw e; + } }