Changeset 6643 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2014-01-06T16:39:45+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/tools
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
r6552 r6643 66 66 exceptionCounter++; 67 67 try { 68 e.printStackTrace();68 Main.error(e); 69 69 if (Main.parent != null) { 70 70 if (e instanceof OutOfMemoryError) { … … 166 166 JOptionPane.showMessageDialog(Main.parent, p, tr("You have encountered a bug in JOSM"), JOptionPane.ERROR_MESSAGE); 167 167 } catch (Exception e1) { 168 e1.printStackTrace();168 Main.error(e1); 169 169 } 170 170 } … … 200 200 "gdata="+Base64.encode(ByteBuffer.wrap(out.toByteArray()), true)); 201 201 } catch (IOException e) { 202 e.printStackTrace();202 Main.error(e); 203 203 return null; 204 204 } -
trunk/src/org/openstreetmap/josm/tools/DateUtils.java
r6380 r6643 12 12 import javax.xml.datatype.DatatypeFactory; 13 13 import javax.xml.datatype.XMLGregorianCalendar; 14 15 import org.openstreetmap.josm.Main; 14 16 15 17 /** … … 37 39 fact = DatatypeFactory.newInstance(); 38 40 } catch(DatatypeConfigurationException ce) { 39 ce.printStackTrace();41 Main.error(ce); 40 42 } 41 43 XML_DATE = fact; -
trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java
r6582 r6643 49 49 */ 50 50 public static String explainOsmApiInitializationException(OsmApiInitializationException e) { 51 e.printStackTrace();51 Main.error(e); 52 52 String msg = tr( 53 53 "<html>Failed to initialize communication with the OSM server {0}.<br>" … … 64 64 */ 65 65 public static String explainMissingOAuthAccessTokenException(MissingOAuthAccessTokenException e) { 66 e.printStackTrace();66 Main.error(e); 67 67 String msg = tr( 68 68 "<html>Failed to authenticate at the OSM server ''{0}''.<br>" … … 129 129 */ 130 130 public static String explainPreconditionFailed(OsmApiException e) { 131 e.printStackTrace();131 Main.error(e); 132 132 Pair<OsmPrimitive, Collection<OsmPrimitive>> conflict = parsePreconditionFailed(e.getErrorHeader()); 133 133 if (conflict != null) { … … 247 247 248 248 public static String explainFailedBasicAuthentication(OsmApiException e) { 249 e.printStackTrace();249 Main.error(e); 250 250 return tr("<html>" 251 251 + "Authentication at the OSM server with the username ''{0}'' failed.<br>" … … 257 257 258 258 public static String explainFailedOAuthAuthentication(OsmApiException e) { 259 e.printStackTrace();259 Main.error(e); 260 260 return tr("<html>" 261 261 + "Authentication at the OSM server with the OAuth token ''{0}'' failed.<br>" … … 267 267 268 268 public static String explainFailedAuthorisation(OsmApiException e) { 269 e.printStackTrace();269 Main.error(e); 270 270 String header = e.getErrorHeader(); 271 271 String body = e.getErrorBody(); … … 298 298 299 299 public static String explainFailedOAuthAuthorisation(OsmApiException e) { 300 e.printStackTrace();300 Main.error(e); 301 301 return tr("<html>" 302 302 + "Authorisation at the OSM server with the OAuth token ''{0}'' failed.<br>" … … 317 317 */ 318 318 public static String explainClientTimeout(OsmApiException e) { 319 e.printStackTrace();319 Main.error(e); 320 320 return tr("<html>" 321 321 + "Communication with the OSM server ''{0}'' timed out. Please retry later." … … 332 332 */ 333 333 public static String explainGenericOsmApiException(OsmApiException e) { 334 e.printStackTrace();334 Main.error(e); 335 335 String errMsg = e.getErrorHeader(); 336 336 if (errMsg == null) { … … 358 358 */ 359 359 public static String explainConflict(OsmApiException e) { 360 e.printStackTrace();360 Main.error(e); 361 361 String msg = e.getErrorHeader(); 362 362 if (msg != null) { … … 374 374 } catch (ParseException ex) { 375 375 Main.error(tr("Failed to parse date ''{0}'' replied by server.", m.group(2))); 376 ex.printStackTrace();376 Main.error(ex); 377 377 } 378 378 if (closeDate == null) { … … 419 419 e.getClosedOn() == null ? "?" : dateFormat.format(e.getClosedOn()) 420 420 ); 421 e.printStackTrace();421 Main.error(e); 422 422 return msg; 423 423 } … … 433 433 msg = e.toString(); 434 434 } 435 e.printStackTrace();435 Main.error(e); 436 436 return escapeReservedCharactersHTML(msg); 437 437 } … … 472 472 String message = tr("<html>Failed to open a connection to the remote server<br>" + "''{0}''.<br>" 473 473 + "Please check your internet connection.", apiUrl); 474 e.printStackTrace();474 Main.error(e); 475 475 return message; 476 476 } … … 491 491 + "Details (untranslated): {1}</html>", apiUrl, ioe 492 492 .getMessage()); 493 e.printStackTrace();493 Main.error(e); 494 494 return message; 495 495 } … … 506 506 + "Its format is either unsupported, ill-formed, and/or inconsistent.<br>" 507 507 + "<br>Details (untranslated): {0}</html>", ide.getMessage()); 508 e.printStackTrace();508 Main.error(e); 509 509 return message; 510 510 } … … 521 521 String message = tr("<html>The OSM server<br>" + "''{0}''<br>" + "reported an internal server error.<br>" 522 522 + "This is most likely a temporary problem. Please try again later.", apiUrl); 523 e.printStackTrace();523 Main.error(e); 524 524 return message; 525 525 } … … 544 544 } 545 545 message = "<html>" + message + "</html>"; 546 e.printStackTrace();546 Main.error(e); 547 547 return message; 548 548 } … … 557 557 // TODO: Write a proper error message 558 558 String message = explainGenericOsmApiException(e); 559 e.printStackTrace();559 Main.error(e); 560 560 return message; 561 561 } … … 575 575 , apiUrl); 576 576 message = "<html>" + message + "</html>"; 577 e.printStackTrace();577 Main.error(e); 578 578 return message; 579 579 } … … 599 599 + "Host name ''{1}'' could not be resolved. <br>" 600 600 + "Please check the API URL in your preferences and your internet connection.", apiUrl, host); 601 e.printStackTrace();601 Main.error(e); 602 602 return message; 603 603 } … … 692 692 msg = explainGeneric(e); 693 693 } 694 e.printStackTrace();694 Main.error(e); 695 695 return msg; 696 696 } -
trunk/src/org/openstreetmap/josm/tools/ExifReader.java
r6380 r6643 7 7 import java.util.Date; 8 8 9 import org.openstreetmap.josm.Main; 9 10 import org.openstreetmap.josm.data.coor.LatLon; 10 11 … … 61 62 throw e; 62 63 } catch (Exception e) { 63 e.printStackTrace();64 Main.error(e); 64 65 } 65 66 return null; … … 87 88 return dir.getInt(ExifIFD0Directory.TAG_ORIENTATION); 88 89 } catch (JpegProcessingException e) { 89 e.printStackTrace();90 Main.error(e); 90 91 } catch (MetadataException e) { 91 e.printStackTrace();92 Main.error(e); 92 93 } catch (IOException e) { 93 e.printStackTrace();94 Main.error(e); 94 95 } 95 96 return null; … … 108 109 return readLatLon(dirGps); 109 110 } catch (JpegProcessingException e) { 110 e.printStackTrace();111 Main.error(e); 111 112 } catch (IOException e) { 112 e.printStackTrace();113 Main.error(e); 113 114 } catch (MetadataException e) { 114 e.printStackTrace();115 Main.error(e); 115 116 } 116 117 return null; … … 121 122 * @param dirGps The EXIF GPS directory 122 123 * @return The lat/lon read in the EXIF section, or {@code null} if {@code dirGps} is null 123 * @throws MetadataException 124 * @throws MetadataException 124 125 * @since 6209 125 126 */ … … 145 146 return readDirection(dirGps); 146 147 } catch (JpegProcessingException e) { 147 e.printStackTrace();148 Main.error(e); 148 149 } catch (IOException e) { 149 e.printStackTrace();150 Main.error(e); 150 151 } 151 152 return null; -
trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
r6514 r6643 73 73 } 74 74 } catch (NumberFormatException x) { 75 x.printStackTrace();75 Main.error(x); 76 76 } catch (NullPointerException x) { 77 x.printStackTrace();77 Main.error(x); 78 78 } catch (ArrayIndexOutOfBoundsException x) { 79 x.printStackTrace();79 Main.error(x); 80 80 } 81 81 return b; -
trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java
r6380 r6643 204 204 } 205 205 } catch (Exception e) { 206 e.printStackTrace(); // SAXException does not dump inner exceptions.206 Main.error(e); // SAXException does not dump inner exceptions. 207 207 throwException(e); 208 208 }
Note: See TracChangeset
for help on using the changeset viewer.