- Timestamp:
- 2010-03-02T17:16:24+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
r2984 r3069 15 15 import org.openstreetmap.josm.Main; 16 16 import org.openstreetmap.josm.io.ChangesetClosedException; 17 import org.openstreetmap.josm.io.IllegalDataException; 17 18 import org.openstreetmap.josm.io.MissingOAuthAccessTokenException; 18 19 import org.openstreetmap.josm.io.OsmApiException; … … 140 141 JOptionPane.ERROR_MESSAGE, 141 142 ht("/ErrorMessages#NestedIOException") 143 ); 144 } 145 146 /** 147 * Explains a {@see IllegalDataException} which has caused an {@see OsmTransferException}. 148 * This is most likely happening when JOSM tries to load data in in an unsupported format. 149 * 150 * @param e the exception 151 */ 152 153 public static void explainNestedIllegalDataException(OsmTransferException e) { 154 HelpAwareOptionPane.showOptionDialog( 155 Main.parent, 156 ExceptionUtil.explainNestedIllegalDataException(e), 157 tr("Illegal Data"), 158 JOptionPane.ERROR_MESSAGE, 159 ht("/ErrorMessages#IllegalDataException") 142 160 ); 143 161 } … … 341 359 return; 342 360 } 361 if (getNestedException(e, IllegalDataException.class) != null) { 362 explainNestedIllegalDataException(e); 363 return; 364 } 343 365 if (e instanceof OsmApiInitializationException) { 344 366 explainOsmApiInitializationException((OsmApiInitializationException) e); -
trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java
r3023 r3069 21 21 import org.openstreetmap.josm.gui.preferences.server.OAuthAccessTokenHolder; 22 22 import org.openstreetmap.josm.io.ChangesetClosedException; 23 import org.openstreetmap.josm.io.IllegalDataException; 23 24 import org.openstreetmap.josm.io.MissingOAuthAccessTokenException; 24 25 import org.openstreetmap.josm.io.OsmApi; … … 283 284 284 285 /** 286 * Explains a {@see IllegalDataException} which has caused an {@see OsmTransferException}. 287 * This is most likely happening when JOSM tries to load data in in an unsupported format. 288 * 289 * @param e the exception 290 */ 291 public static String explainNestedIllegalDataException(OsmTransferException e) { 292 IllegalDataException ide = getNestedException(e, IllegalDataException.class); 293 String message = tr("<html>Failed to download data." 294 + "Its format is either unsupported, ill-formed, and/or inconsistent.<br>" 295 + "<br>Details(untranslated): {0}</html>", ide.getMessage()); 296 e.printStackTrace(); 297 return message; 298 } 299 300 /** 285 301 * Explains a {@see OsmApiException} which was thrown because of an internal server 286 302 * error in the OSM API server.. … … 306 322 String apiUrl = OsmApi.getOsmApi().getBaseUrl(); 307 323 String message = tr("The OSM server ''{0}'' reported a bad request.<br>", apiUrl); 308 if (e.getErrorHeader() != null && 309 (e.getErrorHeader().startsWith("The maximum bbox") || 310 e.getErrorHeader().startsWith("You requested too many nodes"))) {324 if (e.getErrorHeader() != null && 325 (e.getErrorHeader().startsWith("The maximum bbox") || 326 e.getErrorHeader().startsWith("You requested too many nodes"))) { 311 327 message += "<br>" 312 328 + tr("The area you tried to download is too big or your request was too large."
Note:
See TracChangeset
for help on using the changeset viewer.