Changeset 6642 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2014-01-06T15:57:41+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Utils.java
r6623 r6642 419 419 return true; 420 420 } catch (IllegalStateException ex) { 421 ex.printStackTrace();421 Main.error(ex); 422 422 return false; 423 423 } … … 449 449 } 450 450 } catch (UnsupportedFlavorException ex) { 451 ex.printStackTrace();451 Main.error(ex); 452 452 return null; 453 453 } catch (IOException ex) { 454 ex.printStackTrace();454 Main.error(ex); 455 455 return null; 456 456 } … … 895 895 } 896 896 897 /** 898 * Returns the root cause of a throwable object. 899 * @param t The object to get root cause for 900 * @return the root cause of {@code t} 901 * @since 6639 902 */ 903 public static Throwable getRootCause(Throwable t) { 904 Throwable result = t; 905 if (result != null) { 906 Throwable cause = result.getCause(); 907 while (cause != null && cause != result) { 908 result = cause; 909 cause = result.getCause(); 910 } 911 } 912 return result; 913 } 897 914 } -
trunk/src/org/openstreetmap/josm/tools/WikiReader.java
r6380 r6642 18 18 private final String baseurl; 19 19 20 /** 21 * Constructs a new {@code WikiReader} for the given base URL. 22 * @param baseurl The wiki base URL 23 */ 20 24 public WikiReader(String baseurl) { 21 25 this.baseurl = baseurl; … … 80 84 81 85 private String readLang(URL url) throws IOException { 82 BufferedReader in = Utils.openURLReader(url); 86 BufferedReader in; 87 try { 88 in = Utils.openURLReader(url); 89 } catch (IOException e) { 90 Main.addNetworkError(url, Utils.getRootCause(e)); 91 throw e; 92 } 83 93 try { 84 94 return readFromTrac(in, url); … … 124 134 // add a border="0" attribute to images, otherwise the internal help browser 125 135 // will render a thick border around images inside an <a> element 126 //127 136 b += line.replaceAll("<img ", "<img border=\"0\" ") 128 137 .replaceAll("<span class=\"icon\">.</span>", "")
Note:
See TracChangeset
for help on using the changeset viewer.