From: Ben Soares Date: Wed, 29 May 2024 12:08:09 +0000 (+0100) Subject: JAL-4414 Add SocketTimeoutException to exceptions that trigger File Not Found rather... X-Git-Tag: Release_2_11_4_0~28^2~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7bb6882463062279027fa73984328edc864fd047;p=jalview.git JAL-4414 Add SocketTimeoutException to exceptions that trigger File Not Found rather than Format Not Recognised --- diff --git a/src/jalview/bin/Commands.java b/src/jalview/bin/Commands.java index 97ab98e..eb81847 100644 --- a/src/jalview/bin/Commands.java +++ b/src/jalview/bin/Commands.java @@ -292,6 +292,8 @@ public class Commands { addError((protocol == DataSourceType.URL ? "File at URL" : "File") + " '" + openFile + "' not found"); + isError = true; + continue; } catch (FileFormatException e1) { addError("Unknown file format for '" + openFile + "'"); diff --git a/src/jalview/io/FileParse.java b/src/jalview/io/FileParse.java index 57b2ce5..dd85907 100755 --- a/src/jalview/io/FileParse.java +++ b/src/jalview/io/FileParse.java @@ -34,6 +34,7 @@ import java.io.Reader; import java.io.StringReader; import java.net.HttpURLConnection; import java.net.MalformedURLException; +import java.net.SocketTimeoutException; import java.net.URL; import java.net.URLConnection; import java.net.UnknownHostException; @@ -505,7 +506,8 @@ public class FileParse if (suffixLess == null) { if (e instanceof FileNotFoundException - || e instanceof UnknownHostException) + || e instanceof UnknownHostException + || e instanceof SocketTimeoutException) { errormessage = "File at URL '" + fileStr + "' not found"; filenotfound = true; @@ -521,7 +523,9 @@ public class FileParse { errormessage = "BAD URL WITH OR WITHOUT SUFFIX '" + fileStr + "'"; - if (e instanceof FileNotFoundException) + if (e instanceof FileNotFoundException + || e instanceof UnknownHostException + || e instanceof SocketTimeoutException) { filenotfound = true; }