Index: trunk/src/org/openstreetmap/josm/Main.java
===================================================================
--- trunk/src/org/openstreetmap/josm/Main.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/Main.java	(revision 6643)
@@ -227,5 +227,7 @@
         if (logLevel < 1)
             return;
-        System.err.println(tr("ERROR: {0}", msg));
+        if (msg != null && !msg.isEmpty()) {
+            System.err.println(tr("ERROR: {0}", msg));
+        }
     }
 
@@ -237,5 +239,7 @@
         if (logLevel < 2)
             return;
-        System.err.println(tr("WARNING: {0}", msg));
+        if (msg != null && !msg.isEmpty()) {
+            System.err.println(tr("WARNING: {0}", msg));
+        }
     }
 
@@ -247,5 +251,7 @@
         if (logLevel < 3)
             return;
-        System.out.println(tr("INFO: {0}", msg));
+        if (msg != null && !msg.isEmpty()) {
+            System.out.println(tr("INFO: {0}", msg));
+        }
     }
 
@@ -257,5 +263,7 @@
         if (logLevel < 4)
             return;
-        System.out.println(tr("DEBUG: {0}", msg));
+        if (msg != null && !msg.isEmpty()) {
+            System.out.println(tr("DEBUG: {0}", msg));
+        }
     }
 
@@ -323,5 +331,5 @@
      * @param t The throwable object causing the error
      * @param stackTrace {@code true}, if the stacktrace should be displayed
-     * @since 6442
+     * @since 6642
      */
     public static void error(Throwable t, boolean stackTrace) {
@@ -336,5 +344,5 @@
      * @param t The throwable object causing the error
      * @param stackTrace {@code true}, if the stacktrace should be displayed
-     * @since 6442
+     * @since 6642
      */
     public static void warn(Throwable t, boolean stackTrace) {
@@ -1395,5 +1403,5 @@
      * @param t The network error
      * @return The previous error associated to the given resource, if any. Can be {@code null}
-     * @since 6639
+     * @since 6642
      */
     public static Throwable addNetworkError(URL url, Throwable t) {
@@ -1415,5 +1423,5 @@
      * @param t The network error
      * @return The previous error associated to the given resource, if any. Can be {@code null}
-     * @since 6639
+     * @since 6642
      */
     public static Throwable addNetworkError(String url, Throwable t) {
Index: trunk/src/org/openstreetmap/josm/actions/DownloadAlongAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/DownloadAlongAction.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/actions/DownloadAlongAction.java	(revision 6643)
@@ -111,5 +111,5 @@
                     future.get();
                 } catch (Exception e) {
-                    e.printStackTrace();
+                    Main.error(e);
                     return;
                 }
Index: trunk/src/org/openstreetmap/josm/actions/GpxExportAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/GpxExportAction.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/actions/GpxExportAction.java	(revision 6643)
@@ -86,6 +86,6 @@
                 try {
                     exporter.exportData(file, layer);
-                } catch (IOException e1) {
-                    e1.printStackTrace();
+                } catch (IOException e) {
+                    Main.error(e);
                 }
             }
Index: trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java	(revision 6643)
@@ -143,5 +143,5 @@
                     }
                 } catch (Exception e) {
-                    e.printStackTrace();
+                    Main.error(e);
                 }
             }
@@ -163,5 +163,5 @@
                     result.append(task.acceptsDocumentationSummary());
                 } catch (Exception e) {
-                    e.printStackTrace();
+                    Main.error(e);
                 }
             }
Index: trunk/src/org/openstreetmap/josm/actions/RestartAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/RestartAction.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/actions/RestartAction.java	(revision 6643)
@@ -54,5 +54,5 @@
             restartJOSM();
         } catch (IOException ex) {
-            ex.printStackTrace();
+            Main.error(ex);
         }
     }
@@ -123,5 +123,5 @@
                         Runtime.getRuntime().exec(cmd.toArray(new String[cmd.size()]));
                     } catch (IOException e) {
-                        e.printStackTrace();
+                        Main.error(e);
                     }
                 }
Index: trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java	(revision 6643)
@@ -87,5 +87,5 @@
             Main.parent.repaint();
         } catch (IOException e) {
-            e.printStackTrace();
+            Main.error(e);
             return false;
         }
Index: trunk/src/org/openstreetmap/josm/actions/SessionLoadAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SessionLoadAction.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/actions/SessionLoadAction.java	(revision 6643)
@@ -47,6 +47,6 @@
     @Override
     public void actionPerformed(ActionEvent e) {
-        JFileChooser fc = createAndOpenFileChooser(true, false, tr("Open session"), 
-                Arrays.asList(SessionImporter.FILE_FILTER, FileFilterAllFiles.getInstance()), 
+        JFileChooser fc = createAndOpenFileChooser(true, false, tr("Open session"),
+                Arrays.asList(SessionImporter.FILE_FILTER, FileFilterAllFiles.getInstance()),
                 SessionImporter.FILE_FILTER, JFileChooser.FILES_ONLY, "lastDirectory");
         if (fc == null) return;
@@ -174,5 +174,5 @@
                 }
             } catch (IllegalDataException e) {
-                e.printStackTrace();
+                Main.error(e);
                 HelpAwareOptionPane.showMessageDialogInEDT(
                         Main.parent,
@@ -184,5 +184,5 @@
                 cancel();
             } catch (IOException e) {
-                e.printStackTrace();
+                Main.error(e);
                 HelpAwareOptionPane.showMessageDialogInEDT(
                         Main.parent,
Index: trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java	(revision 6643)
@@ -134,5 +134,5 @@
             sw.write(file);
         } catch (IOException ex) {
-            ex.printStackTrace();
+            Main.error(ex);
             HelpAwareOptionPane.showMessageDialogInEDT(
                     Main.parent,
Index: trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java	(revision 6643)
@@ -165,5 +165,5 @@
             }
         } catch (Exception x) {
-            x.printStackTrace();
+            Main.error(x);
         }
 
Index: trunk/src/org/openstreetmap/josm/actions/UpdateDataAction.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/UpdateDataAction.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/actions/UpdateDataAction.java	(revision 6643)
@@ -97,5 +97,5 @@
                                 future.get();
                             } catch(Exception e) {
-                                e.printStackTrace();
+                                Main.error(e);
                                 return;
                             }
Index: trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadSessionTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadSessionTask.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadSessionTask.java	(revision 6643)
@@ -55,9 +55,9 @@
                 return Main.worker.submit(loader);
             } catch (URISyntaxException e) {
-                e.printStackTrace();
+                Main.error(e);
             } catch (MalformedURLException e) {
-                e.printStackTrace();
+                Main.error(e);
             } catch (IOException e) {
-                e.printStackTrace();
+                Main.error(e);
             }
         }
Index: trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java	(revision 6643)
@@ -249,5 +249,5 @@
                     future.get();
                 } catch (Exception e) {
-                    e.printStackTrace();
+                    Main.error(e);
                     return;
                 }
Index: trunk/src/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandler.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandler.java	(revision 6643)
@@ -70,5 +70,5 @@
                 future.get();
             } catch(Exception e) {
-                e.printStackTrace();
+                Main.error(e);
                 return;
             }
Index: trunk/src/org/openstreetmap/josm/command/ConflictAddCommand.java
===================================================================
--- trunk/src/org/openstreetmap/josm/command/ConflictAddCommand.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/command/ConflictAddCommand.java	(revision 6643)
@@ -41,5 +41,5 @@
             getLayer().getConflicts().add(conflict);
         } catch(IllegalStateException e) {
-            e.printStackTrace();
+            Main.error(e);
             warnBecauseOfDoubleConflict();
         }
Index: trunk/src/org/openstreetmap/josm/data/AutosaveTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/AutosaveTask.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/data/AutosaveTask.java	(revision 6643)
@@ -216,5 +216,4 @@
                 Main.error("Autosave failed:");
                 Main.error(t);
-                t.printStackTrace();
             }
         }
Index: trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java	(revision 6643)
@@ -274,6 +274,6 @@
             ts.transform(new DOMSource(exportDocument), new StreamResult(f.toURI().getPath()));
         } catch (Exception ex) {
-            Main.warn("Error saving preferences part: " +ex.getMessage());
-            ex.printStackTrace();
+            Main.warn("Error saving preferences part:");
+            Main.error(ex);
         }
     }
Index: trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 6643)
@@ -781,5 +781,5 @@
             }
         } catch(IOException e) {
-            e.printStackTrace();
+            Main.error(e);
             JOptionPane.showMessageDialog(
                     Main.parent,
@@ -793,5 +793,5 @@
             load();
         } catch (Exception e) {
-            e.printStackTrace();
+            Main.error(e);
             File backupFile = new File(prefDir,"preferences.xml.bak");
             JOptionPane.showMessageDialog(
@@ -806,5 +806,5 @@
                 save();
             } catch(IOException e1) {
-                e1.printStackTrace();
+                Main.error(e1);
                 Main.warn(tr("Failed to initialize preferences. Failed to reset preference file to default: {0}", getPreferenceFile()));
             }
Index: trunk/src/org/openstreetmap/josm/data/ServerSidePreferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/ServerSidePreferences.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/data/ServerSidePreferences.java	(revision 6643)
@@ -78,5 +78,4 @@
             } catch (IOException e) {
                 Main.error(e);
-                e.printStackTrace();
             }
             return null;
@@ -107,5 +106,5 @@
                         );
             } catch (Exception e) {
-                e.printStackTrace();
+                Main.error(e);
                 JOptionPane.showMessageDialog(
                         Main.parent,
@@ -123,5 +122,5 @@
             connection = new Connection(new URL(serverUrl+"user/preferences"));
         } catch (MalformedURLException e) {
-            e.printStackTrace();
+            Main.error(e);
             JOptionPane.showMessageDialog(
                     Main.parent,
@@ -173,7 +172,7 @@
             fromXML(in);
         } catch (RuntimeException e) {
-            e.printStackTrace();
+            Main.error(e);
         } catch (XMLStreamException e) {
-            e.printStackTrace();
+            Main.error(e);
         }
         return res;
Index: trunk/src/org/openstreetmap/josm/data/Version.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/Version.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/data/Version.java	(revision 6643)
@@ -50,5 +50,5 @@
         } catch (IOException e) {
             Main.error(tr("Failed to load resource ''{0}'', error is {1}.", resource.toString(), e.toString()));
-            e.printStackTrace();
+            Main.error(e);
         }
         return s;
Index: trunk/src/org/openstreetmap/josm/data/imagery/WmsCache.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/WmsCache.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/data/imagery/WmsCache.java	(revision 6643)
@@ -126,5 +126,5 @@
             } catch (IOException e) {
                 Main.error("Unable to load layers index for wms cache");
-                e.printStackTrace();
+                Main.error(e);
             }
 
@@ -152,5 +152,5 @@
                 } catch (IOException e) {
                     Main.error("Unable to save layer index for wms cache");
-                    e.printStackTrace();
+                    Main.error(e);
                 }
             }
@@ -201,5 +201,5 @@
         } catch (Exception e) {
             if (indexFile.exists()) {
-                e.printStackTrace();
+                Main.error(e);
                 Main.info("Unable to load index for wms-cache, new file will be created");
             } else {
@@ -298,5 +298,5 @@
         } catch (Exception e) {
             Main.error("Failed to save wms-cache file");
-            e.printStackTrace();
+            Main.error(e);
         }
     }
@@ -365,5 +365,5 @@
             } catch (IOException e) {
                 Main.error("Unable to load file from wms cache");
-                e.printStackTrace();
+                Main.error(e);
                 return null;
             }
Index: trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/data/osm/DataSet.java	(revision 6643)
@@ -791,5 +791,4 @@
     }
 
-
     /**
      * Show message and stack trace in log in case primitive is not found
@@ -803,5 +802,5 @@
                     + "at http://josm.openstreetmap.de/. This is not a critical error, it should be safe to continue in your work.",
                     primitiveId.getType(), Long.toString(primitiveId.getUniqueId())));
-            new Exception().printStackTrace();
+            Main.error(new Exception());
         }
 
Index: trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(revision 6643)
@@ -160,5 +160,5 @@
             }
         } catch (Exception e){
-            e.printStackTrace();
+            Main.error(e);
         }
     }
@@ -174,7 +174,7 @@
                 }
             } catch (final FileNotFoundException e) {
-                // Ignore
+                Main.debug(Main.getErrorMessage(e));
             } catch (final IOException e) {
-                e.printStackTrace();
+                Main.error(e);
             } finally {
                 Utils.close(in);
@@ -199,5 +199,5 @@
             }
         } catch (IOException e) {
-            e.printStackTrace();
+            Main.error(e);
         } finally {
             Utils.close(out);
@@ -291,5 +291,5 @@
                 }
             } catch (Exception e) {
-                e.printStackTrace();
+                Main.error(e);
                 JOptionPane.showMessageDialog(Main.parent,
                         tr("Error initializing test {0}:\n {1}", test.getClass()
Index: trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java	(revision 6643)
@@ -90,5 +90,5 @@
      */
     public static void explainGeneric(Exception e) {
-        e.printStackTrace();
+        Main.error(e);
         BugReportExceptionHandler.handleException(e);
     }
Index: trunk/src/org/openstreetmap/josm/gui/FileDrop.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/FileDrop.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/FileDrop.java	(revision 6643)
@@ -85,6 +85,6 @@
     private static Color defaultBorderColor = new Color( 0f, 0f, 1f, 0.25f );
 
-    /** 
-     * Constructor for JOSM file drop 
+    /**
+     * Constructor for JOSM file drop
      * @param c The drop target
      */
@@ -226,10 +226,10 @@
             catch ( IOException io)
             {   Main.warn("FileDrop: IOException - abort:" );
-            io.printStackTrace();
+            Main.error(io);
             evt.rejectDrop();
             }   // end catch IOException
             catch (UnsupportedFlavorException ufe)
             {   Main.warn("FileDrop: UnsupportedFlavorException - abort:" );
-            ufe.printStackTrace();
+            Main.error(ufe);
             evt.rejectDrop();
             }   // end catch: UnsupportedFlavorException
@@ -333,5 +333,5 @@
         }   // end try
         catch( TooManyListenersException e )
-        {   e.printStackTrace();
+        {   Main.error(e);
         Main.warn("FileDrop: Drop will not work due to previous error. Do you have another listener attached?" );
         }   // end catch
@@ -413,5 +413,5 @@
      *
      * @param c The component to unregister as a drop target
-     * @return {@code true} if at least one item has been removed, {@code false} otherwise 
+     * @return {@code true} if at least one item has been removed, {@code false} otherwise
      */
     public static boolean remove( Component c)
Index: trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/JosmUserIdentityManager.java	(revision 6643)
@@ -65,5 +65,5 @@
                     instance.initFromOAuth(Main.parent);
                 } catch (Throwable t) {
-                    t.printStackTrace();
+                    Main.error(t);
                     // Fall back to preferences if OAuth identification fails for any reason
                     instance.initFromPreferences();
@@ -218,7 +218,7 @@
             setFullyIdentified(info.getDisplayName(), info);
         } catch (IllegalArgumentException e) {
-            e.printStackTrace();
+            Main.error(e);
         } catch (OsmTransferException e) {
-            e.printStackTrace();
+            Main.error(e);
         }
     }
@@ -277,5 +277,5 @@
                     instance.initFromOAuth(Main.parent);
                 } catch (Throwable t) {
-                    t.printStackTrace();
+                    Main.error(t);
                 }
             }
Index: trunk/src/org/openstreetmap/josm/gui/MapStatus.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/MapStatus.java	(revision 6643)
@@ -904,5 +904,5 @@
                 thread.interrupt();
             } catch (Exception e) {
-                e.printStackTrace();
+                Main.error(e);
             }
         }
Index: trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java	(revision 6643)
@@ -273,5 +273,5 @@
             }
         } catch (Exception e) {
-            e.printStackTrace();
+            Main.error(e);
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java	(revision 6643)
@@ -46,4 +46,5 @@
 import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker;
 import org.openstreetmap.gui.jmapviewer.interfaces.TileLoader;
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.Version;
@@ -718,5 +719,5 @@
                 g.drawRect(x_min, y_min, w, h);
             } catch (Exception e) {
-                e.printStackTrace();
+                Main.error(e);
             }
         }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java	(revision 6643)
@@ -514,6 +514,6 @@
                         } catch(InterruptedException e) {
                             Main.warn("InterruptedException in "+getClass().getSimpleName()+" while downloading changeset header");
-                        } catch(ExecutionException e){
-                            e.printStackTrace();
+                        } catch(ExecutionException e) {
+                            Main.error(e);
                             BugReportExceptionHandler.handleException(e.getCause());
                             return;
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 6643)
@@ -847,5 +847,5 @@
                     } else {
                         Main.warn("Button " + button + " doesn't have action defined");
-                        new Exception().printStackTrace();
+                        Main.error(new Exception());
                     }
                 }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java	(revision 6643)
@@ -223,5 +223,5 @@
                 return getBaseUserUrl() + "/" + URLEncoder.encode(user.getName(), "UTF-8").replaceAll("\\+", "%20");
             } catch(UnsupportedEncodingException e) {
-                e.printStackTrace();
+                Main.error(e);
                 JOptionPane.showMessageDialog(
                         Main.parent,
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java	(revision 6643)
@@ -1094,10 +1094,10 @@
                             }
                         } catch (Exception e) {
-                            e.printStackTrace();
+                            Main.error(e);
                         }
                     }
                 });
             } catch (Exception e1) {
-                e1.printStackTrace();
+                Main.error(e1);
             }
         }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTree.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTree.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTree.java	(revision 6643)
@@ -132,5 +132,5 @@
                 return;
             if (lastException != null) {
-                lastException.printStackTrace();
+                Main.error(lastException);
                 return;
             }
Index: trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java	(revision 6643)
@@ -246,8 +246,8 @@
                 }
             } catch (NumberFormatException x) {
-                x.printStackTrace(); // SAXException does not chain correctly
+                Main.error(x); // SAXException does not chain correctly
                 throw new SAXException(x.getMessage(), x);
             } catch (NullPointerException x) {
-                x.printStackTrace(); // SAXException does not chain correctly
+                Main.error(x); // SAXException does not chain correctly
                 throw new SAXException(tr("Null pointer exception, possibly some missing tags."), x);
             }
Index: trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/help/HelpBrowser.java	(revision 6643)
@@ -146,5 +146,5 @@
         } catch(Exception e) {
             Main.error(tr("Failed to read CSS file ''help-browser.css''. Exception is: {0}", e.toString()));
-            e.printStackTrace();
+            Main.error(e);
             return ss;
         } finally {
@@ -237,5 +237,5 @@
             help.getEditorKit().read(new StringReader(content), document, 0);
         } catch (Exception e) {
-            e.printStackTrace();
+            Main.error(e);
         }
         help.setDocument(document);
@@ -317,15 +317,15 @@
                     return;
                 } catch(HelpContentReaderException e2) {
-                    e2.printStackTrace();
+                    Main.error(e2);
                     handleHelpContentReaderException(relativeHelpTopic, e2);
                     return;
                 }
             } catch(HelpContentReaderException e1) {
-                e1.printStackTrace();
+                Main.error(e1);
                 handleHelpContentReaderException(relativeHelpTopic, e1);
                 return;
             }
         } catch(HelpContentReaderException e) {
-            e.printStackTrace();
+            Main.error(e);
             handleHelpContentReaderException(relativeHelpTopic, e);
             return;
@@ -352,5 +352,5 @@
             return;
         } catch(HelpContentReaderException e) {
-            e.printStackTrace();
+            Main.error(e);
             handleHelpContentReaderException(absoluteHelpTopic, e);
             return;
@@ -556,5 +556,5 @@
                 } catch (BadLocationException e) {
                     Main.warn(tr("Bad location in HTML document. Exception was: {0}", e.toString()));
-                    e.printStackTrace();
+                    Main.error(e);
                 }
             }
Index: trunk/src/org/openstreetmap/josm/gui/history/VersionInfoPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/history/VersionInfoPanel.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/history/VersionInfoPanel.java	(revision 6643)
@@ -154,5 +154,5 @@
                 }
             } catch(UnsupportedEncodingException e) {
-                e.printStackTrace();
+                Main.error(e);
                 lblUser.setUrl(null);
             }
@@ -172,5 +172,5 @@
                     lblUser.setUrl(url);
                 } catch(UnsupportedEncodingException e) {
-                    e.printStackTrace();
+                    Main.error(e);
                     lblUser.setUrl(null);
                 }
Index: trunk/src/org/openstreetmap/josm/gui/io/DownloadFileTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/DownloadFileTask.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/io/DownloadFileTask.java	(revision 6643)
@@ -149,5 +149,5 @@
             download();
         } catch(DownloadException e) {
-            e.printStackTrace();
+            Main.error(e);
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/io/SaveLayerTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/SaveLayerTask.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/io/SaveLayerTask.java	(revision 6643)
@@ -4,4 +4,5 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.SaveAction;
 import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
@@ -56,5 +57,5 @@
             }
         } catch(Exception e) {
-            e.printStackTrace();
+            Main.error(e);
             setLastException(e);
         }
Index: trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java	(revision 6643)
@@ -28,6 +28,6 @@
 import javax.swing.DefaultListCellRenderer;
 import javax.swing.ImageIcon;
+import javax.swing.JButton;
 import javax.swing.JComponent;
-import javax.swing.JButton;
 import javax.swing.JDialog;
 import javax.swing.JLabel;
@@ -482,5 +482,5 @@
                     model.setUploadState(layerInfo.getLayer(), UploadOrSaveState.CANCELED);
                 } catch(Exception e) {
-                    e.printStackTrace();
+                    Main.error(e);
                     model.setUploadState(layerInfo.getLayer(), UploadOrSaveState.FAILED);
                     ExceptionDialogUtil.explainException(e);
@@ -489,5 +489,5 @@
                     model.setUploadState(layerInfo.getLayer(), UploadOrSaveState.CANCELED);
                 } else if (currentTask.isFailed()) {
-                    currentTask.getLastException().printStackTrace();
+                    Main.error(currentTask.getLastException());
                     ExceptionDialogUtil.explainException(currentTask.getLastException());
                     model.setUploadState(layerInfo.getLayer(), UploadOrSaveState.FAILED);
@@ -516,5 +516,5 @@
                     model.setSaveState(layerInfo.getLayer(), UploadOrSaveState.CANCELED);
                 } catch(Exception e) {
-                    e.printStackTrace();
+                    Main.error(e);
                     model.setSaveState(layerInfo.getLayer(), UploadOrSaveState.FAILED);
                     ExceptionDialogUtil.explainException(e);
@@ -524,5 +524,5 @@
                 } else if (currentTask.isFailed()) {
                     if (currentTask.getLastException() != null) {
-                        currentTask.getLastException().printStackTrace();
+                        Main.error(currentTask.getLastException());
                         ExceptionDialogUtil.explainException(currentTask.getLastException());
                     }
Index: trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java	(revision 6643)
@@ -254,5 +254,5 @@
                     break;
                 } catch(OsmTransferCanceledException e) {
-                    e.printStackTrace();
+                    Main.error(e);
                     uploadCanceled = true;
                     break uploadloop;
Index: trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java	(revision 6643)
@@ -78,5 +78,5 @@
 import org.xml.sax.SAXException;
 
-/** 
+/**
  * This class displays the window to select the GPX file and the offset (timezone + delta).
  * Then it correlates the images of the layer with that GPX file.
@@ -180,5 +180,5 @@
 
                 } catch (SAXException x) {
-                    x.printStackTrace();
+                    Main.error(x);
                     JOptionPane.showMessageDialog(
                             Main.parent,
@@ -189,5 +189,5 @@
                     return;
                 } catch (IOException x) {
-                    x.printStackTrace();
+                    Main.error(x);
                     JOptionPane.showMessageDialog(
                             Main.parent,
@@ -1145,5 +1145,5 @@
                         } catch(ParseException e) {
                             Main.error("Error while parsing date \"" + curWpTimeStr + '"');
-                            e.printStackTrace();
+                            Main.error(e);
                             prevWp = null;
                             prevWpTime = 0;
Index: trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java	(revision 6643)
@@ -182,5 +182,5 @@
                         canonical = f.getCanonicalPath();
                     } catch (IOException e) {
-                        e.printStackTrace();
+                        Main.error(e);
                         rememberError(tr("Unable to get canonical path for directory {0}\n",
                                 f.getAbsolutePath()));
@@ -199,5 +199,5 @@
                             addRecursiveFiles(files, Arrays.asList(children));
                         } catch(NullPointerException npe) {
-                            npe.printStackTrace();
+                            Main.error(npe);
                             rememberError(tr("Found null file in directory {0}\n", f.getPath()));
                         }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 6643)
@@ -254,5 +254,5 @@
         } catch (IOException e) {
             Main.warn(tr("Failed to load Mappaint styles from ''{0}''. Exception was: {1}", entry.url, e.toString()));
-            e.printStackTrace();
+            Main.error(e);
         } finally {
             Utils.close(in);
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 6643)
@@ -79,13 +79,13 @@
         } catch (IOException e) {
             Main.warn(tr("Failed to load Mappaint styles from ''{0}''. Exception was: {1}", url, e.toString()));
-            e.printStackTrace();
+            Main.error(e);
             logError(e);
         } catch (TokenMgrError e) {
             Main.warn(tr("Failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage()));
-            e.printStackTrace();
+            Main.error(e);
             logError(e);
         } catch (ParseException e) {
             Main.warn(tr("Failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage()));
-            e.printStackTrace();
+            Main.error(e);
             logError(new ParseException(e.getMessage())); // allow e to be garbage collected, it links to the entire token stream
         }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java	(revision 6643)
@@ -83,13 +83,13 @@
         } catch (IOException e) {
             Main.warn(tr("Failed to load Mappaint styles from ''{0}''. Exception was: {1}", url, e.toString()));
-            e.printStackTrace();
+            Main.error(e);
             logError(e);
         } catch (SAXParseException e) {
             Main.warn(tr("Failed to parse Mappaint styles from ''{0}''. Error was: [{1}:{2}] {3}", url, e.getLineNumber(), e.getColumnNumber(), e.getMessage()));
-            e.printStackTrace();
+            Main.error(e);
             logError(e);
         } catch (SAXException e) {
             Main.warn(tr("Failed to parse Mappaint styles from ''{0}''. Error was: {1}", url, e.getMessage()));
-            e.printStackTrace();
+            Main.error(e);
             logError(e);
         }
Index: trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/oauth/FullyAutomaticAuthorizationUI.java	(revision 6643)
@@ -196,5 +196,5 @@
             }
         } catch(CredentialsAgentException e) {
-            e.printStackTrace();
+            Main.error(e);
             tfUserName.setText("");
             tfPassword.setText("");
@@ -525,5 +525,5 @@
                 }
             };
-            e.printStackTrace();
+            Main.error(e);
             GuiHelper.runInEDT(r);
         }
Index: trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java	(revision 6643)
@@ -111,11 +111,11 @@
                 }
             } catch (NoSuchFieldException e) {
-                e.printStackTrace();
+                Main.error(e);
                 Main.warn(tr("Failed to cancel running OAuth operation"));
             } catch (SecurityException e) {
-                e.printStackTrace();
+                Main.error(e);
                 Main.warn(tr("Failed to cancel running OAuth operation"));
             } catch (IllegalAccessException e) {
-                e.printStackTrace();
+                Main.error(e);
                 Main.warn(tr("Failed to cancel running OAuth operation"));
             }
Index: trunk/src/org/openstreetmap/josm/gui/oauth/RetrieveAccessTokenTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/oauth/RetrieveAccessTokenTask.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/oauth/RetrieveAccessTokenTask.java	(revision 6643)
@@ -9,4 +9,5 @@
 import javax.swing.JOptionPane;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.oauth.OAuthParameters;
 import org.openstreetmap.josm.data.oauth.OAuthToken;
@@ -87,5 +88,5 @@
             return;
         } catch (OsmOAuthAuthorizationException e) {
-            e.printStackTrace();
+            Main.error(e);
             alertRetrievingAccessTokenFailed(e);
             accessToken = null;
Index: trunk/src/org/openstreetmap/josm/gui/oauth/RetrieveRequestTokenTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/oauth/RetrieveRequestTokenTask.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/oauth/RetrieveRequestTokenTask.java	(revision 6643)
@@ -9,4 +9,5 @@
 import javax.swing.JOptionPane;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.oauth.OAuthParameters;
 import org.openstreetmap.josm.data.oauth.OAuthToken;
@@ -81,5 +82,5 @@
             return;
         } catch (OsmOAuthAuthorizationException e) {
-            e.printStackTrace();
+            Main.error(e);
             alertRetrievingRequestTokenFailed(e);
             requestToken = null;
Index: trunk/src/org/openstreetmap/josm/gui/oauth/TestAccessTokenTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/oauth/TestAccessTokenTask.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/oauth/TestAccessTokenTask.java	(revision 6643)
@@ -17,4 +17,5 @@
 import oauth.signpost.exception.OAuthException;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.oauth.OAuthParameters;
 import org.openstreetmap.josm.data.oauth.OAuthToken;
@@ -253,9 +254,9 @@
         }catch(OsmOAuthAuthorizationException e) {
             if (canceled) return;
-            e.printStackTrace();
+            Main.error(e);
             alertFailedSigning();
         } catch(OsmApiException e) {
             if (canceled) return;
-            e.printStackTrace();
+            Main.error(e);
             if (e.getResponseCode() == HttpURLConnection.HTTP_INTERNAL_ERROR) {
                 alertInternalError();
@@ -271,5 +272,5 @@
         } catch(OsmTransferException e) {
             if (canceled) return;
-            e.printStackTrace();
+            Main.error(e);
             alertFailedConnection();
         }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java	(revision 6643)
@@ -552,5 +552,5 @@
                                     sps.addGui(this);
                                 } catch (SecurityException ex) {
-                                    ex.printStackTrace();
+                                    Main.error(ex);
                                 } catch (Throwable ex) {
                                     BugReportExceptionHandler.handleException(ex);
@@ -566,5 +566,5 @@
                     setSelectedIndex(index);
                 } catch (SecurityException ex) {
-                    ex.printStackTrace();
+                    Main.error(ex);
                 } catch (Throwable ex) {
                     // allow to change most settings even if e.g. a plugin fails
Index: trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 6643)
@@ -732,5 +732,5 @@
                         return true;
                     } catch (Exception e) {
-                        e.printStackTrace();
+                        Main.error(e);
                     }
                     return false;
@@ -751,5 +751,5 @@
                             }
                         } catch (Exception e) {
-                            e.printStackTrace();
+                            Main.error(e);
                         }
                         movingComponent = "";
Index: trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java	(revision 6643)
@@ -12,7 +12,7 @@
 import java.util.List;
 import java.util.Map;
+import java.util.Map.Entry;
 import java.util.Observable;
 import java.util.Set;
-import java.util.Map.Entry;
 
 import org.openstreetmap.josm.Main;
@@ -359,5 +359,5 @@
                 oldinfo.updateLocalInfo(newinfo);
             } catch(PluginException e) {
-                e.printStackTrace();
+                Main.error(e);
             }
         }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/server/ApiUrlTestTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/server/ApiUrlTestTask.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/server/ApiUrlTestTask.java	(revision 6643)
@@ -14,4 +14,5 @@
 import javax.swing.JOptionPane;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.HelpAwareOptionPane;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
@@ -211,5 +212,5 @@
                 // ignore exceptions
                 return;
-            e.printStackTrace();
+            Main.error(e);
             alertConnectionFailed();
             return;
Index: trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java	(revision 6643)
@@ -108,5 +108,5 @@
             }
         } catch(CredentialsAgentException e) {
-            e.printStackTrace();
+            Main.error(e);
             Main.warn(tr("Failed to retrieve OSM credentials from credential manager."));
             Main.warn(tr("Current credential manager is of type ''{0}''", cm.getClass().getName()));
@@ -128,5 +128,5 @@
             cm.store(RequestorType.SERVER, OsmApi.getOsmApi().getHost(), pa);
         } catch (CredentialsAgentException e) {
-            e.printStackTrace();
+            Main.error(e);
             Main.warn(tr("Failed to save OSM credentials to credential manager."));
             Main.warn(tr("Current credential manager is of type ''{0}''", cm.getClass().getName()));
Index: trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAccessTokenHolder.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAccessTokenHolder.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAccessTokenHolder.java	(revision 6643)
@@ -154,5 +154,5 @@
             token = cm.lookupOAuthAccessToken();
         } catch(CredentialsAgentException e) {
-            e.printStackTrace();
+            Main.error(e);
             Main.warn(tr("Failed to retrieve OAuth Access Token from credential manager"));
             Main.warn(tr("Current credential manager is of type ''{0}''", cm.getClass().getName()));
@@ -185,5 +185,5 @@
             }
         } catch(CredentialsAgentException e){
-            e.printStackTrace();
+            Main.error(e);
             Main.warn(tr("Failed to store OAuth Access Token to credentials manager"));
             Main.warn(tr("Current credential manager is of type ''{0}''", cm.getClass().getName()));
Index: trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java	(revision 6643)
@@ -359,5 +359,5 @@
             }
         } catch(CredentialsAgentException e) {
-            e.printStackTrace();
+            Main.error(e);
             tfProxyHttpUser.setText("");
             tfProxyHttpPassword.setText("");
@@ -434,5 +434,5 @@
             cm.store(RequestorType.PROXY, tfProxyHttpHost.getText(), pa);
         } catch(CredentialsAgentException e) {
-            e.printStackTrace();
+            Main.error(e);
         }
     }
Index: trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java	(revision 6643)
@@ -83,5 +83,5 @@
                     }
                 } catch (Exception e) {
-                    e.printStackTrace();
+                    Main.error(e);
                 }
             }
Index: trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java	(revision 6643)
@@ -82,7 +82,7 @@
                 SwingUtilities.invokeAndWait(task);
             } catch (InterruptedException e) {
-                e.printStackTrace();
+                Main.error(e);
             } catch (InvocationTargetException e) {
-                e.printStackTrace();
+                Main.error(e);
             }
         }
Index: trunk/src/org/openstreetmap/josm/io/CacheCustomContent.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/CacheCustomContent.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/CacheCustomContent.java	(revision 6643)
@@ -173,5 +173,5 @@
             output.flush();
         } catch(Exception e) {
-            e.printStackTrace();
+            Main.error(e);
         } finally {
             Utils.close(output);
Index: trunk/src/org/openstreetmap/josm/io/ChangesetClosedException.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/ChangesetClosedException.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/ChangesetClosedException.java	(revision 6643)
@@ -84,5 +84,5 @@
             } catch(ParseException ex) {
                 Main.error(tr("Failed to parse date ''{0}'' replied by server.", m.group(2)));
-                ex.printStackTrace();
+                Main.error(ex);
             }
         } else {
Index: trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java	(revision 6643)
@@ -19,4 +19,5 @@
 import java.util.Map.Entry;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -259,5 +260,5 @@
                 sb.append("display_name").append("=").append(URLEncoder.encode(userName, "UTF-8"));
             } catch (UnsupportedEncodingException e) {
-                e.printStackTrace();
+                Main.error(e);
             }
         }
Index: trunk/src/org/openstreetmap/josm/io/FileImporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/FileImporter.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/FileImporter.java	(revision 6643)
@@ -83,5 +83,5 @@
     
     private static void displayError(File f, Exception e) {
-        e.printStackTrace();
+        Main.error(e);
         HelpAwareOptionPane.showMessageDialogInEDT(
                 Main.parent,
@@ -110,5 +110,5 @@
             return true;
         } catch (Exception e) {
-            e.printStackTrace();
+            Main.error(e);
             HelpAwareOptionPane.showMessageDialogInEDT(
                     Main.parent,
Index: trunk/src/org/openstreetmap/josm/io/GpxExporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/GpxExporter.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/GpxExporter.java	(revision 6643)
@@ -179,5 +179,5 @@
             fo.flush();
         } catch (IOException x) {
-            x.printStackTrace();
+            Main.error(x);
             JOptionPane.showMessageDialog(Main.parent, tr("Error while exporting {0}:\n{1}", fn, x.getMessage()),
                     tr("Error"), JOptionPane.ERROR_MESSAGE);
Index: trunk/src/org/openstreetmap/josm/io/GpxImporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/GpxImporter.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/GpxImporter.java	(revision 6643)
@@ -92,5 +92,5 @@
             addLayers(loadLayers(r.getGpxData(), parsedProperly, fileName, tr("Markers from {0}", fileName)));
         } catch (SAXException e) {
-            e.printStackTrace();
+            Main.error(e);
             throw new IOException(tr("Parsing data for layer ''{0}'' failed", fileName));
         }
@@ -167,5 +167,5 @@
             return loadLayers(r.getGpxData(), parsedProperly, gpxLayerName, markerLayerName);
         } catch (SAXException e) {
-            e.printStackTrace();
+            Main.error(e);
             throw new IOException(tr("Parsing data for layer ''{0}'' failed", gpxLayerName));
         }
Index: trunk/src/org/openstreetmap/josm/io/GpxReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/GpxReader.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/GpxReader.java	(revision 6643)
@@ -467,5 +467,5 @@
                 throw e;
         } catch (ParserConfigurationException e) {
-            e.printStackTrace(); // broken SAXException chaining
+            Main.error(e); // broken SAXException chaining
             throw new SAXException(e);
         }
Index: trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java	(revision 6643)
@@ -357,7 +357,7 @@
                 }
             } catch (InterruptedException e) {
-                e.printStackTrace();
+                Main.error(e);
             } catch (ExecutionException e) {
-                e.printStackTrace();
+                Main.error(e);
             }
         }
Index: trunk/src/org/openstreetmap/josm/io/OsmChangeImporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmChangeImporter.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/OsmChangeImporter.java	(revision 6643)
@@ -25,4 +25,7 @@
             "osc,osc.bz2,osc.bz,osc.gz", "osc", tr("OsmChange File") + " (*.osc *.osc.bz2 *.osc.bz *.osc.gz)");
 
+    /**
+     * Constructs a new {@code OsmChangeImporter}.
+     */
     public OsmChangeImporter() {
         super(FILE_FILTER);
@@ -46,5 +49,5 @@
 
         } catch (FileNotFoundException e) {
-            e.printStackTrace();
+            Main.error(e);
             throw new IOException(tr("File ''{0}'' does not exist.", file.getName()));
         }
Index: trunk/src/org/openstreetmap/josm/io/OsmConnection.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmConnection.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/OsmConnection.java	(revision 6643)
@@ -9,5 +9,4 @@
 import java.nio.CharBuffer;
 import java.nio.charset.CharacterCodingException;
-import java.nio.charset.Charset;
 import java.nio.charset.CharsetEncoder;
 
@@ -42,8 +41,11 @@
             HttpURLConnection.setFollowRedirects(true);
         } catch (SecurityException e) {
-            e.printStackTrace();
+            Main.error(e);
         }
     }
 
+    /**
+     * Cancels the connection.
+     */
     public void cancel() {
         cancel = true;
Index: trunk/src/org/openstreetmap/josm/io/OsmExporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmExporter.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/OsmExporter.java	(revision 6643)
@@ -87,5 +87,5 @@
             layer.onPostSaveToFile();
         } catch (IOException e) {
-            e.printStackTrace();
+            Main.error(e);
             JOptionPane.showMessageDialog(
                     Main.parent,
@@ -102,5 +102,5 @@
                 }
             } catch (IOException e2) {
-                e2.printStackTrace();
+                Main.error(e2);
                 JOptionPane.showMessageDialog(
                         Main.parent,
Index: trunk/src/org/openstreetmap/josm/io/OsmHistoryReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmHistoryReader.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/OsmHistoryReader.java	(revision 6643)
@@ -11,4 +11,5 @@
 import javax.xml.parsers.SAXParserFactory;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.history.HistoryDataSet;
 import org.openstreetmap.josm.data.osm.history.HistoryOsmPrimitive;
@@ -42,4 +43,5 @@
         }
 
+        @Override
         protected void throwException(String message) throws SAXException {
             throw new SAXException(getCurrentPosition() + message);
@@ -86,5 +88,5 @@
             SAXParserFactory.newInstance().newSAXParser().parse(inputSource, new Parser());
         } catch (ParserConfigurationException e) {
-            e.printStackTrace(); // broken SAXException chaining
+            Main.error(e); // broken SAXException chaining
             throw new SAXException(e);
         } finally {
Index: trunk/src/org/openstreetmap/josm/io/OsmImporter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmImporter.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/OsmImporter.java	(revision 6643)
@@ -65,5 +65,5 @@
             importData(in, file, progressMonitor);
         } catch (FileNotFoundException e) {
-            e.printStackTrace();
+            Main.error(e);
             throw new IOException(tr("File ''{0}'' does not exist.", file.getName()));
         } finally {
Index: trunk/src/org/openstreetmap/josm/io/OsmServerReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/OsmServerReader.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/OsmServerReader.java	(revision 6643)
@@ -110,5 +110,5 @@
                 activeConnection.connect();
             } catch (Exception e) {
-                e.printStackTrace();
+                Main.error(e);
                 OsmTransferException ote = new OsmTransferException(tr("Could not connect to the OSM server. Please check your internet connection."), e);
                 ote.setUrl(url.toString());
@@ -171,5 +171,5 @@
      * @param progressMonitor The progress monitor
      * @return The corresponding dataset
-     * @throws OsmTransferException if any error occurs 
+     * @throws OsmTransferException if any error occurs
      */
     public abstract DataSet parseOsm(final ProgressMonitor progressMonitor) throws OsmTransferException;
@@ -179,5 +179,5 @@
      * @param progressMonitor The progress monitor
      * @return The corresponding dataset
-     * @throws OsmTransferException if any error occurs 
+     * @throws OsmTransferException if any error occurs
      */
     public DataSet parseOsmChange(final ProgressMonitor progressMonitor) throws OsmTransferException {
@@ -189,5 +189,5 @@
      * @param progressMonitor The progress monitor
      * @return The corresponding dataset
-     * @throws OsmTransferException if any error occurs 
+     * @throws OsmTransferException if any error occurs
      */
     public DataSet parseOsmChangeBzip2(final ProgressMonitor progressMonitor) throws OsmTransferException {
@@ -199,5 +199,5 @@
      * @param progressMonitor The progress monitor
      * @return The corresponding dataset
-     * @throws OsmTransferException if any error occurs 
+     * @throws OsmTransferException if any error occurs
      */
     public DataSet parseOsmChangeGzip(final ProgressMonitor progressMonitor) throws OsmTransferException {
@@ -230,5 +230,5 @@
      * @param progressMonitor The progress monitor
      * @return The corresponding dataset
-     * @throws OsmTransferException if any error occurs 
+     * @throws OsmTransferException if any error occurs
      */
     public DataSet parseOsmBzip2(final ProgressMonitor progressMonitor) throws OsmTransferException {
@@ -240,5 +240,5 @@
      * @param progressMonitor The progress monitor
      * @return The corresponding dataset
-     * @throws OsmTransferException if any error occurs 
+     * @throws OsmTransferException if any error occurs
      */
     public DataSet parseOsmGzip(final ProgressMonitor progressMonitor) throws OsmTransferException {
Index: trunk/src/org/openstreetmap/josm/io/auth/DefaultAuthenticator.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/auth/DefaultAuthenticator.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/auth/DefaultAuthenticator.java	(revision 6643)
@@ -7,4 +7,5 @@
 import java.util.Map;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.io.OsmApi;
 
@@ -57,5 +58,5 @@
             return new PasswordAuthentication(response.getUsername(), response.getPassword());
         } catch(CredentialsAgentException e) {
-            e.printStackTrace();
+            Main.error(e);
             return null;
         }
Index: trunk/src/org/openstreetmap/josm/io/imagery/Grabber.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/imagery/Grabber.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/imagery/Grabber.java	(revision 6643)
@@ -70,5 +70,5 @@
                 }
                 if(i == maxTries) {
-                    e.printStackTrace();
+                    Main.error(e);
                     request.finish(State.FAILED, null);
                 }
Index: trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java	(revision 6643)
@@ -15,4 +15,5 @@
 import javax.xml.parsers.SAXParserFactory;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.imagery.ImageryInfo;
 import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryBounds;
@@ -21,5 +22,4 @@
 import org.openstreetmap.josm.io.MirroredInputStream;
 import org.openstreetmap.josm.io.UTFInputStreamReader;
-import org.openstreetmap.josm.tools.Utils;
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
@@ -59,5 +59,5 @@
             throw e;
         } catch (ParserConfigurationException e) {
-            e.printStackTrace(); // broken SAXException chaining
+            Main.error(e); // broken SAXException chaining
             throw new SAXException(e);
         }
Index: trunk/src/org/openstreetmap/josm/io/imagery/WMSGrabber.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/imagery/WMSGrabber.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/imagery/WMSGrabber.java	(revision 6643)
@@ -72,6 +72,6 @@
 
         } catch(Exception e) {
-            e.printStackTrace();
-            throw new Exception(e.getMessage() + "\nImage couldn't be fetched: " + (url != null ? url.toString() : ""));
+            Main.error(e);
+            throw new Exception(e.getMessage() + "\nImage couldn't be fetched: " + (url != null ? url.toString() : ""), e);
         }
     }
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java	(revision 6643)
@@ -40,5 +40,5 @@
                     Integer.toString(port), ex.getLocalizedMessage());
         } catch (IOException ioe) {
-            ioe.printStackTrace();
+            Main.error(ioe);
         }
     }
@@ -54,5 +54,5 @@
                 instance = null;
             } catch (IOException ioe) {
-                ioe.printStackTrace();
+                Main.error(ioe);
             }
         }
@@ -64,7 +64,5 @@
      * @throws IOException when connection errors
      */
-    public RemoteControlHttpServer(int port)
-        throws IOException
-    {
+    public RemoteControlHttpServer(int port) throws IOException {
         super("RemoteControl HTTP Server");
         this.setDaemon(true);
@@ -81,23 +79,16 @@
      */
     @Override
-    public void run()
-    {
+    public void run() {
         Main.info(marktr("RemoteControl::Accepting connections on port {0}"),
              Integer.toString(server.getLocalPort()));
-        while (true)
-        {
-            try
-            {
+        while (true) {
+            try {
                 Socket request = server.accept();
                 RequestProcessor.processRequest(request);
-            }
-            catch( SocketException se)
-            {
+            } catch( SocketException se) {
                 if( !server.isClosed() )
-                    se.printStackTrace();
-                }
-            catch (IOException ioe)
-            {
-                ioe.printStackTrace();
+                    Main.error(se);
+            } catch (IOException ioe) {
+                Main.error(ioe);
             }
         }
@@ -109,6 +100,5 @@
      * @throws IOException
      */
-    public void stopServer() throws IOException
-    {
+    public void stopServer() throws IOException {
         server.close();
         Main.info(marktr("RemoteControl::Server stopped."));
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java	(revision 6643)
@@ -240,6 +240,7 @@
 
         } catch (IOException ioe) {
+            Main.debug(Main.getErrorMessage(ioe));
         } catch (Exception e) {
-            e.printStackTrace();
+            Main.error(e);
             try {
                 sendError(out);
@@ -250,4 +251,5 @@
                 request.close();
             } catch (IOException e) {
+                Main.debug(Main.getErrorMessage(e));
             }
         }
@@ -389,5 +391,5 @@
             handler = handlers.get(cmd).newInstance();
         } catch (Exception ex) {
-            ex.printStackTrace();
+            Main.error(ex);
             return null;
         }
@@ -450,5 +452,5 @@
      * @return HTML message with the description of all available commands
      * @throws IllegalAccessException
-     * @throws InstantiationException 
+     * @throws InstantiationException
      */
     public static String getUsageAsHtml() throws IllegalAccessException, InstantiationException {
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java	(revision 6643)
@@ -36,5 +36,5 @@
         } catch (Exception ex) {
             Main.warn("RemoteControl: Error parsing import remote control request:");
-            ex.printStackTrace();
+            Main.error(ex);
             throw new RequestHandlerErrorException();
         }
Index: trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java	(revision 6643)
@@ -89,9 +89,9 @@
     public String[] getUsageExamples(String cmd) {
         if (command.equals(cmd)) {
-            return new String[] { 
+            return new String[] {
                     "/load_and_zoom?addtags=wikipedia:de=Wei%C3%9Fe_Gasse|maxspeed=5&select=way23071688,way23076176,way23076177,&left=13.740&right=13.741&top=51.05&bottom=51.049",
                     "/load_and_zoom?left=8.19&right=8.20&top=48.605&bottom=48.590&select=node413602999&new_layer=true"};
         } else {
-            return new String[] { 
+            return new String[] {
             "/zoom?left=8.19&right=8.20&top=48.605&bottom=48.590&select=node413602999"};
         }
@@ -139,5 +139,5 @@
         } catch (Exception ex) {
             Main.warn("RemoteControl: Error parsing load_and_zoom remote control request:");
-            ex.printStackTrace();
+            Main.error(ex);
             throw new RequestHandlerErrorException();
         }
Index: trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/session/SessionReader.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/io/session/SessionReader.java	(revision 6643)
@@ -458,5 +458,5 @@
                 }
                 if (exception != null) {
-                    exception.printStackTrace();
+                    Main.error(exception);
                     CancelOrContinueDialog dialog = new CancelOrContinueDialog();
                     dialog.show(
Index: trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java	(revision 6643)
@@ -163,5 +163,5 @@
                 download(d, pluginFile);
             } catch(PluginDownloadException e) {
-                e.printStackTrace();
+                Main.error(e);
                 failed.add(d);
                 continue;
Index: trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 6643)
@@ -560,14 +560,5 @@
             msg = null;
         } catch (PluginException e) {
-            Main.error(e.getMessage());
-            Throwable cause = e.getCause();
-            if (cause != null) {
-                msg = cause.getLocalizedMessage();
-                if (msg != null) {
-                    Main.error("Cause: " + cause.getClass().getName()+": " + msg);
-                } else {
-                    cause.printStackTrace();
-                }
-            }
+            Main.error(e);
             if (e.getCause() instanceof ClassNotFoundException) {
                 msg = tr("<html>Could not load plugin {0} because the plugin<br>main class ''{1}'' was not found.<br>"
@@ -575,5 +566,5 @@
             }
         }  catch (Throwable e) {
-            e.printStackTrace();
+            Main.error(e);
         }
         if (msg != null && confirmDisablePlugin(parent, msg, plugin.name)) {
@@ -687,5 +678,5 @@
                 future.get();
             } catch(ExecutionException e) {
-                e.printStackTrace();
+                Main.error(e);
                 return null;
             } catch(InterruptedException e) {
@@ -817,5 +808,5 @@
                 } catch (PluginException e) {
                     Main.warn(tr("Failed to find plugin {0}", name));
-                    e.printStackTrace();
+                    Main.error(e);
                 }
             }
@@ -858,5 +849,5 @@
             } catch (ExecutionException e) {
                 Main.warn(tr("Failed to download plugin information list")+": ExecutionException");
-                e.printStackTrace();
+                Main.error(e);
                 // don't abort in case of error, continue with downloading plugins below
             } catch (InterruptedException e) {
@@ -905,5 +896,5 @@
                     future.get();
                 } catch(ExecutionException e) {
-                    e.printStackTrace();
+                    Main.error(e);
                     alertFailedPluginUpdate(parent, pluginsToUpdate);
                     return plugins;
@@ -1098,5 +1089,5 @@
                 pi.updateFromJar(new PluginInformation(downloadedPluginFile, pi.name));
             } catch(PluginException e) {
-                e.printStackTrace();
+                Main.error(e);
             }
         }
Index: trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java
===================================================================
--- trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java	(revision 6643)
@@ -248,5 +248,5 @@
                     }
                 }
-                catch(Exception e) { e.printStackTrace(); }
+                catch(Exception e) { Main.error(e); }
             }
         }
Index: trunk/src/org/openstreetmap/josm/plugins/PluginListParser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/plugins/PluginListParser.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/plugins/PluginListParser.java	(revision 6643)
@@ -1,6 +1,4 @@
 // License: GPL. For details, see LICENSE file.
 package org.openstreetmap.josm.plugins;
-
-import org.openstreetmap.josm.tools.Utils;
 
 import static org.openstreetmap.josm.tools.I18n.tr;
@@ -13,4 +11,7 @@
 import java.util.LinkedList;
 import java.util.List;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -104,5 +105,5 @@
             }
         } catch (PluginListParseException ex) {
-            ex.printStackTrace();
+            Main.error(ex);
         }
     }
Index: trunk/src/org/openstreetmap/josm/plugins/ReadLocalPluginInformationTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/plugins/ReadLocalPluginInformationTask.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/plugins/ReadLocalPluginInformationTask.java	(revision 6643)
@@ -92,5 +92,5 @@
             } catch(PluginListParseException e) {
                 Main.warn(tr("Failed to scan file ''{0}'' for plugin information. Skipping.", fname));
-                e.printStackTrace();
+                Main.error(e);
             }
             monitor.worked(1);
Index: trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java	(revision 6643)
@@ -181,5 +181,5 @@
         } catch (MalformedURLException e) {
             if (canceled) return null;
-            e.printStackTrace();
+            Main.error(e);
             return null;
         } catch (IOException e) {
@@ -234,6 +234,6 @@
                     JosmTextArea area = new JosmTextArea(details);
                     area.setEditable(false);
-                    area.setLineWrap(true);  
-                    area.setWrapStyleWord(true); 
+                    area.setLineWrap(true);
+                    area.setWrapStyleWord(true);
                     JScrollPane scrollPane = new JScrollPane(area);
                     scrollPane.setPreferredSize(new Dimension(500, 300));
@@ -273,5 +273,5 @@
         } catch (MalformedURLException e) {
             if (canceled) return;
-            e.printStackTrace();
+            Main.error(e);
             return;
         } catch (IOException e) {
@@ -322,5 +322,5 @@
         } catch(IOException e) {
             // just failed to write the cache file. No big deal, but log the exception anyway
-            e.printStackTrace();
+            Main.error(e);
         } finally {
             if (writer != null) {
@@ -367,5 +367,5 @@
         } catch (PluginListParseException e) {
             Main.error(tr("Failed to parse plugin list document from site ''{0}''. Skipping site. Exception was: {1}", site, e.toString()));
-            e.printStackTrace();
+            Main.error(e);
         }
     }
Index: trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java	(revision 6643)
@@ -66,5 +66,5 @@
         exceptionCounter++;
         try {
-            e.printStackTrace();
+            Main.error(e);
             if (Main.parent != null) {
                 if (e instanceof OutOfMemoryError) {
@@ -166,5 +166,5 @@
                             JOptionPane.showMessageDialog(Main.parent, p, tr("You have encountered a bug in JOSM"), JOptionPane.ERROR_MESSAGE);
                         } catch (Exception e1) {
-                            e1.printStackTrace();
+                            Main.error(e1);
                         }
                     }
@@ -200,5 +200,5 @@
                     "gdata="+Base64.encode(ByteBuffer.wrap(out.toByteArray()), true));
         } catch (IOException e) {
-            e.printStackTrace();
+            Main.error(e);
             return null;
         }
Index: trunk/src/org/openstreetmap/josm/tools/DateUtils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/DateUtils.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/tools/DateUtils.java	(revision 6643)
@@ -12,4 +12,6 @@
 import javax.xml.datatype.DatatypeFactory;
 import javax.xml.datatype.XMLGregorianCalendar;
+
+import org.openstreetmap.josm.Main;
 
 /**
@@ -37,5 +39,5 @@
             fact = DatatypeFactory.newInstance();
         } catch(DatatypeConfigurationException ce) {
-            ce.printStackTrace();
+            Main.error(ce);
         }
         XML_DATE = fact;
Index: trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java	(revision 6643)
@@ -49,5 +49,5 @@
      */
     public static String explainOsmApiInitializationException(OsmApiInitializationException e) {
-        e.printStackTrace();
+        Main.error(e);
         String msg = tr(
                 "<html>Failed to initialize communication with the OSM server {0}.<br>"
@@ -64,5 +64,5 @@
      */
     public static String explainMissingOAuthAccessTokenException(MissingOAuthAccessTokenException e) {
-        e.printStackTrace();
+        Main.error(e);
         String msg = tr(
                 "<html>Failed to authenticate at the OSM server ''{0}''.<br>"
@@ -129,5 +129,5 @@
      */
     public static String explainPreconditionFailed(OsmApiException e) {
-        e.printStackTrace();
+        Main.error(e);
         Pair<OsmPrimitive, Collection<OsmPrimitive>> conflict = parsePreconditionFailed(e.getErrorHeader());
         if (conflict != null) {
@@ -247,5 +247,5 @@
 
     public static String explainFailedBasicAuthentication(OsmApiException e) {
-        e.printStackTrace();
+        Main.error(e);
         return tr("<html>"
                 + "Authentication at the OSM server with the username ''{0}'' failed.<br>"
@@ -257,5 +257,5 @@
 
     public static String explainFailedOAuthAuthentication(OsmApiException e) {
-        e.printStackTrace();
+        Main.error(e);
         return tr("<html>"
                 + "Authentication at the OSM server with the OAuth token ''{0}'' failed.<br>"
@@ -267,5 +267,5 @@
 
     public static String explainFailedAuthorisation(OsmApiException e) {
-        e.printStackTrace();
+        Main.error(e);
         String header = e.getErrorHeader();
         String body = e.getErrorBody();
@@ -298,5 +298,5 @@
 
     public static String explainFailedOAuthAuthorisation(OsmApiException e) {
-        e.printStackTrace();
+        Main.error(e);
         return tr("<html>"
                 + "Authorisation at the OSM server with the OAuth token ''{0}'' failed.<br>"
@@ -317,5 +317,5 @@
      */
     public static String explainClientTimeout(OsmApiException e) {
-        e.printStackTrace();
+        Main.error(e);
         return tr("<html>"
                 + "Communication with the OSM server ''{0}'' timed out. Please retry later."
@@ -332,5 +332,5 @@
      */
     public static String explainGenericOsmApiException(OsmApiException e) {
-        e.printStackTrace();
+        Main.error(e);
         String errMsg = e.getErrorHeader();
         if (errMsg == null) {
@@ -358,5 +358,5 @@
      */
     public static String explainConflict(OsmApiException e) {
-        e.printStackTrace();
+        Main.error(e);
         String msg = e.getErrorHeader();
         if (msg != null) {
@@ -374,5 +374,5 @@
                 } catch (ParseException ex) {
                     Main.error(tr("Failed to parse date ''{0}'' replied by server.", m.group(2)));
-                    ex.printStackTrace();
+                    Main.error(ex);
                 }
                 if (closeDate == null) {
@@ -419,5 +419,5 @@
                 e.getClosedOn() == null ? "?" : dateFormat.format(e.getClosedOn())
         );
-        e.printStackTrace();
+        Main.error(e);
         return msg;
     }
@@ -433,5 +433,5 @@
             msg = e.toString();
         }
-        e.printStackTrace();
+        Main.error(e);
         return escapeReservedCharactersHTML(msg);
     }
@@ -472,5 +472,5 @@
         String message = tr("<html>Failed to open a connection to the remote server<br>" + "''{0}''.<br>"
                 + "Please check your internet connection.", apiUrl);
-        e.printStackTrace();
+        Main.error(e);
         return message;
     }
@@ -491,5 +491,5 @@
                 + "Details (untranslated): {1}</html>", apiUrl, ioe
                 .getMessage());
-        e.printStackTrace();
+        Main.error(e);
         return message;
     }
@@ -506,5 +506,5 @@
                 + "Its format is either unsupported, ill-formed, and/or inconsistent.<br>"
                 + "<br>Details (untranslated): {0}</html>", ide.getMessage());
-        e.printStackTrace();
+        Main.error(e);
         return message;
     }
@@ -521,5 +521,5 @@
         String message = tr("<html>The OSM server<br>" + "''{0}''<br>" + "reported an internal server error.<br>"
                 + "This is most likely a temporary problem. Please try again later.", apiUrl);
-        e.printStackTrace();
+        Main.error(e);
         return message;
     }
@@ -544,5 +544,5 @@
         }
         message = "<html>" + message + "</html>";
-        e.printStackTrace();
+        Main.error(e);
         return message;
     }
@@ -557,5 +557,5 @@
         // TODO: Write a proper error message
         String message = explainGenericOsmApiException(e);
-        e.printStackTrace();
+        Main.error(e);
         return message;
     }
@@ -575,5 +575,5 @@
                 , apiUrl);
         message = "<html>" + message + "</html>";
-        e.printStackTrace();
+        Main.error(e);
         return message;
     }
@@ -599,5 +599,5 @@
                 + "Host name ''{1}'' could not be resolved. <br>"
                 + "Please check the API URL in your preferences and your internet connection.", apiUrl, host);
-        e.printStackTrace();
+        Main.error(e);
         return message;
     }
@@ -692,5 +692,5 @@
             msg = explainGeneric(e);
         }
-        e.printStackTrace();
+        Main.error(e);
         return msg;
     }
Index: trunk/src/org/openstreetmap/josm/tools/ExifReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ExifReader.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/tools/ExifReader.java	(revision 6643)
@@ -7,4 +7,5 @@
 import java.util.Date;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.LatLon;
 
@@ -61,5 +62,5 @@
             throw e;
         } catch (Exception e) {
-            e.printStackTrace();
+            Main.error(e);
         }
         return null;
@@ -87,9 +88,9 @@
             return dir.getInt(ExifIFD0Directory.TAG_ORIENTATION);
         } catch (JpegProcessingException e) {
-            e.printStackTrace();
+            Main.error(e);
         } catch (MetadataException e) {
-            e.printStackTrace();
+            Main.error(e);
         } catch (IOException e) {
-            e.printStackTrace();
+            Main.error(e);
         }
         return null;
@@ -108,9 +109,9 @@
             return readLatLon(dirGps);
         } catch (JpegProcessingException e) {
-            e.printStackTrace();
+            Main.error(e);
         } catch (IOException e) {
-            e.printStackTrace();
+            Main.error(e);
         } catch (MetadataException e) {
-            e.printStackTrace();
+            Main.error(e);
         }
         return null;
@@ -121,5 +122,5 @@
      * @param dirGps The EXIF GPS directory
      * @return The lat/lon read in the EXIF section, or {@code null} if {@code dirGps} is null
-     * @throws MetadataException 
+     * @throws MetadataException
      * @since 6209
      */
@@ -145,7 +146,7 @@
             return readDirection(dirGps);
         } catch (JpegProcessingException e) {
-            e.printStackTrace();
+            Main.error(e);
         } catch (IOException e) {
-            e.printStackTrace();
+            Main.error(e);
         }
         return null;
Index: trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java	(revision 6643)
@@ -73,9 +73,9 @@
             }
         } catch (NumberFormatException x) {
-            x.printStackTrace();
+            Main.error(x);
         } catch (NullPointerException x) {
-            x.printStackTrace();
+            Main.error(x);
         } catch (ArrayIndexOutOfBoundsException x) {
-            x.printStackTrace();
+            Main.error(x);
         }
         return b;
Index: trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java	(revision 6642)
+++ trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java	(revision 6643)
@@ -204,5 +204,5 @@
                 }
             } catch (Exception e) {
-                e.printStackTrace(); // SAXException does not dump inner exceptions.
+                Main.error(e); // SAXException does not dump inner exceptions.
                 throwException(e);
             }
