Changeset 3255 in josm
- Timestamp:
- 2010-05-15T21:57:19+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
r3101 r3255 340 340 HelpAwareOptionPane.showOptionDialog( 341 341 Main.parent, 342 ExceptionUtil.explainNestedUnk onwnHostException(e),342 ExceptionUtil.explainNestedUnknownHostException(e), 343 343 tr("Unknown host"), 344 344 JOptionPane.ERROR_MESSAGE, -
trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java
r3083 r3255 353 353 @Override 354 354 protected void realRun() throws SAXException, IOException, OsmTransferException { 355 String urlString = useserver.url+java.net.URLEncoder.encode(searchExpression, "UTF-8"); 356 355 357 try { 356 358 getProgressMonitor().indeterminateSubTask(tr("Querying name server ...")); 357 URL url = new URL(u seserver.url+java.net.URLEncoder.encode(searchExpression, "UTF-8"));359 URL url = new URL(urlString); 358 360 synchronized(this) { 359 361 connection = (HttpURLConnection)url.openConnection(); … … 369 371 // ignore exception 370 372 return; 371 lastException = e; 373 OsmTransferException ex = new OsmTransferException(e); 374 ex.setUrl(urlString); 375 lastException = ex; 372 376 } 373 377 } -
trunk/src/org/openstreetmap/josm/io/OsmTransferException.java
r3083 r3255 3 3 4 4 public class OsmTransferException extends Exception { 5 6 private String url = OsmApi.getOsmApi().getBaseUrl(); 5 7 6 8 public OsmTransferException() { … … 19 21 } 20 22 23 public void setUrl(String url) { 24 this.url = url; 25 } 26 27 /** 28 * 29 * @return Api base url or url set using setUrl method 30 */ 31 public String getUrl() { 32 return url; 33 } 34 21 35 } -
trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java
r3112 r3255 144 144 /** 145 145 * Explains an OSM API exception because of a client timeout (HTTP 408). 146 * 146 * 147 147 * @param e the exception 148 148 * @return the message … … 159 159 /** 160 160 * Replies a generic error message for an OSM API exception 161 * 161 * 162 162 * @param e the exception 163 163 * @return the message … … 278 278 279 279 public static String explainSecurityException(OsmTransferException e) { 280 String apiUrl = OsmApi.getOsmApi().getBaseUrl();280 String apiUrl = e.getUrl(); 281 281 String host = tr("unknown"); 282 282 try { … … 301 301 302 302 public static String explainNestedSocketException(OsmTransferException e) { 303 String apiUrl = OsmApi.getOsmApi().getBaseUrl();303 String apiUrl = e.getUrl(); 304 304 String message = tr("<html>Failed to open a connection to the remote server<br>" + "''{0}''.<br>" 305 305 + "Please check your internet connection.</html>", apiUrl); … … 318 318 public static String explainNestedIOException(OsmTransferException e) { 319 319 IOException ioe = getNestedException(e, IOException.class); 320 String apiUrl = OsmApi.getOsmApi().getBaseUrl();320 String apiUrl = e.getUrl(); 321 321 String message = tr("<html>Failed to upload data to or download data from<br>" + "''{0}''<br>" 322 322 + "due to a problem with transferring data.<br>" + "Details(untranslated): {1}</html>", apiUrl, ioe … … 349 349 350 350 public static String explainInternalServerError(OsmTransferException e) { 351 String apiUrl = OsmApi.getOsmApi().getBaseUrl();351 String apiUrl = e.getUrl(); 352 352 String message = tr("<html>The OSM server<br>" + "''{0}''<br>" + "reported an internal server error.<br>" 353 353 + "This is most likely a temporary problem. Please try again later.</html>", apiUrl); … … 404 404 */ 405 405 406 public static String explainNestedUnk onwnHostException(OsmTransferException e) {407 String apiUrl = OsmApi.getOsmApi().getBaseUrl();406 public static String explainNestedUnknownHostException(OsmTransferException e) { 407 String apiUrl = e.getUrl(); 408 408 String host = tr("unknown"); 409 409 try { … … 453 453 return explainNestedSocketException(e); 454 454 if (getNestedException(e, UnknownHostException.class) != null) 455 return explainNestedUnk onwnHostException(e);455 return explainNestedUnknownHostException(e); 456 456 if (getNestedException(e, IOException.class) != null) 457 457 return explainNestedIOException(e);
Note:
See TracChangeset
for help on using the changeset viewer.