From: hansonr Date: Tue, 21 Aug 2018 12:14:33 +0000 (-0500) Subject: JAL-3026 fixes ?j2strace=xxx message, user.home, error msg in X-Git-Tag: Develop-2_11_2_0-d20201215~24^2~68^2~474 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=97e2831b327bd80268a39cdd5a6d948d9fe4d185;p=jalview.git JAL-3026 fixes ?j2strace=xxx message, user.home, error msg in ItentifiersUrlProvider --- diff --git a/src/jalview/urls/IdentifiersUrlProvider.java b/src/jalview/urls/IdentifiersUrlProvider.java index 0988e7d..f32e590 100644 --- a/src/jalview/urls/IdentifiersUrlProvider.java +++ b/src/jalview/urls/IdentifiersUrlProvider.java @@ -83,6 +83,7 @@ public class IdentifiersUrlProvider extends UrlProviderImpl // identifiers.org data HashMap idData = new HashMap(); + String errorMessage = null; try { FileReader reader = new FileReader(idFileName); @@ -116,19 +117,19 @@ public class IdentifiersUrlProvider extends UrlProviderImpl (String) item.get("prefix")); idData.put((String) item.get("id"), link); } - } catch (FileNotFoundException e) + } catch (IOException | ParseException e) { - e.printStackTrace(); - idData.clear(); - } catch (IOException e) - { - e.printStackTrace(); - idData.clear(); - } catch (ParseException e) - { - e.printStackTrace(); + // unnecessary e.printStackTrace(); + // Note how in JavaScript we can grab the first bytes from any file reader. + // Typical report here is "NetworkError" because the file does not exist. + // "https://." is coming from System.getProperty("user.home"), but this could + // be set by the page developer to anything, of course. + errorMessage = (/** @j2sNative String.fromCharCode.apply(null, reader.$in.is.buf.slice(0,12)) || */e.toString()); idData.clear(); } + // BH 2018 -- added more valuable report + if (errorMessage != null) + System.err.println("IdentifiersUrlProvider: cannot read " + idFileName + ": " + errorMessage); return idData; } diff --git a/swingjs/SwingJS-site.zip b/swingjs/SwingJS-site.zip index fb76e52..59ed2a4 100644 Binary files a/swingjs/SwingJS-site.zip and b/swingjs/SwingJS-site.zip differ diff --git a/swingjs/timestamp b/swingjs/timestamp index 8f8d9ad..d762baa 100644 --- a/swingjs/timestamp +++ b/swingjs/timestamp @@ -1 +1 @@ -20180820232825 +20180821071128 diff --git a/swingjs/ver/3.2.2/SwingJS-site.zip b/swingjs/ver/3.2.2/SwingJS-site.zip index fb76e52..59ed2a4 100644 Binary files a/swingjs/ver/3.2.2/SwingJS-site.zip and b/swingjs/ver/3.2.2/SwingJS-site.zip differ diff --git a/swingjs/ver/3.2.2/timestamp b/swingjs/ver/3.2.2/timestamp index 8f8d9ad..d762baa 100644 --- a/swingjs/ver/3.2.2/timestamp +++ b/swingjs/ver/3.2.2/timestamp @@ -1 +1 @@ -20180820232825 +20180821071128