Index: /trunk/src/org/openstreetmap/josm/gui/MapView.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 10585)
+++ /trunk/src/org/openstreetmap/josm/gui/MapView.java	(revision 10586)
@@ -920,51 +920,18 @@
         synchronized (temporaryLayers) {
             for (MapViewPaintable mvp : temporaryLayers) {
-                mvp.paint(tempG, this, box);
+                try {
+                    mvp.paint(tempG, this, box);
+                } catch (RuntimeException e) {
+                    throw BugReport.intercept(e).put("mvp", mvp);
+                }
             }
         }
 
         // draw world borders
-        tempG.setColor(Color.WHITE);
-        Bounds b = getProjection().getWorldBoundsLatLon();
-        double lat = b.getMinLat();
-        double lon = b.getMinLon();
-
-        Point p = getPoint(b.getMin());
-
-        GeneralPath path = new GeneralPath();
-
-        double d = 1.0;
-        path.moveTo(p.x, p.y);
-        double max = b.getMax().lat();
-        for (; lat <= max; lat += d) {
-            p = getPoint(new LatLon(lat >= max ? max : lat, lon));
-            path.lineTo(p.x, p.y);
-        }
-        lat = max; max = b.getMax().lon();
-        for (; lon <= max; lon += d) {
-            p = getPoint(new LatLon(lat, lon >= max ? max : lon));
-            path.lineTo(p.x, p.y);
-        }
-        lon = max; max = b.getMinLat();
-        for (; lat >= max; lat -= d) {
-            p = getPoint(new LatLon(lat <= max ? max : lat, lon));
-            path.lineTo(p.x, p.y);
-        }
-        lat = max; max = b.getMinLon();
-        for (; lon >= max; lon -= d) {
-            p = getPoint(new LatLon(lat, lon <= max ? max : lon));
-            path.lineTo(p.x, p.y);
-        }
-
-        int w = getWidth();
-        int h = getHeight();
-
-        // Work around OpenJDK having problems when drawing out of bounds
-        final Area border = new Area(path);
-        // Make the viewport 1px larger in every direction to prevent an
-        // additional 1px border when zooming in
-        final Area viewport = new Area(new Rectangle(-1, -1, w + 2, h + 2));
-        border.intersect(viewport);
-        tempG.draw(border);
+        try {
+            drawWorldBorders(tempG);
+        } catch (RuntimeException e) {
+            throw BugReport.intercept(e).put("bounds", () -> getProjection().getWorldBoundsLatLon());
+        }
 
         if (Main.isDisplayingMapView() && Main.map.filterDialog != null) {
@@ -1007,4 +974,49 @@
     }
 
+    private void drawWorldBorders(Graphics2D tempG) {
+        tempG.setColor(Color.WHITE);
+        Bounds b = getProjection().getWorldBoundsLatLon();
+        double lat = b.getMinLat();
+        double lon = b.getMinLon();
+
+        Point p = getPoint(b.getMin());
+
+        GeneralPath path = new GeneralPath();
+
+        double d = 1.0;
+        path.moveTo(p.x, p.y);
+        double max = b.getMax().lat();
+        for (; lat <= max; lat += d) {
+            p = getPoint(new LatLon(lat >= max ? max : lat, lon));
+            path.lineTo(p.x, p.y);
+        }
+        lat = max; max = b.getMax().lon();
+        for (; lon <= max; lon += d) {
+            p = getPoint(new LatLon(lat, lon >= max ? max : lon));
+            path.lineTo(p.x, p.y);
+        }
+        lon = max; max = b.getMinLat();
+        for (; lat >= max; lat -= d) {
+            p = getPoint(new LatLon(lat <= max ? max : lat, lon));
+            path.lineTo(p.x, p.y);
+        }
+        lat = max; max = b.getMinLon();
+        for (; lon >= max; lon -= d) {
+            p = getPoint(new LatLon(lat, lon <= max ? max : lon));
+            path.lineTo(p.x, p.y);
+        }
+
+        int w = getWidth();
+        int h = getHeight();
+
+        // Work around OpenJDK having problems when drawing out of bounds
+        final Area border = new Area(path);
+        // Make the viewport 1px larger in every direction to prevent an
+        // additional 1px border when zooming in
+        final Area viewport = new Area(new Rectangle(-1, -1, w + 2, h + 2));
+        border.intersect(viewport);
+        tempG.draw(border);
+    }
+
     /**
      * Sets up the viewport to prepare for drawing the view.
Index: /trunk/src/org/openstreetmap/josm/gui/MapViewState.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MapViewState.java	(revision 10585)
+++ /trunk/src/org/openstreetmap/josm/gui/MapViewState.java	(revision 10586)
@@ -18,4 +18,5 @@
 import org.openstreetmap.josm.data.projection.Projection;
 import org.openstreetmap.josm.gui.download.DownloadDialog;
+import org.openstreetmap.josm.tools.bugreport.BugReport;
 
 /**
@@ -97,5 +98,9 @@
             component = component.getParent();
         }
-        topLeftOnScreen = position.getLocationOnScreen();
+        try {
+            topLeftOnScreen = position.getLocationOnScreen();
+        } catch (RuntimeException e) {
+            throw BugReport.intercept(e).put("position", position).put("parent", () -> position.getParent());
+        }
     }
 
Index: /trunk/src/org/openstreetmap/josm/tools/bugreport/BugReport.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/bugreport/BugReport.java	(revision 10585)
+++ /trunk/src/org/openstreetmap/josm/tools/bugreport/BugReport.java	(revision 10586)
@@ -20,5 +20,6 @@
  * You should then add some debug information there. This can be the OSM ids that caused the error, information on the data you were working on
  * or other local variables. Make sure that no excpetions may occur while computing the values. It is best to send plain local variables to
- * put(...). Then simply throw the throwable you got from the bug report. The global exception handler will do the rest.
+ * put(...). If you need to do computations, put them into a lambda expression. Then simply throw the throwable you got from the bug report.
+ * The global exception handler will do the rest.
  * <pre>
  * int id = ...;
@@ -27,10 +28,10 @@
  *   ... your code ...
  * } catch (RuntimeException t) {
- *   throw BugReport.intercept(t).put("id", id).put("tag", tag);
+ *   throw BugReport.intercept(t).put("id", id).put("tag", () -> x.getTag());
  * }
  * </pre>
  *
  * Instead of re-throwing, you can call {@link ReportedException#warn()}. This will display a warning to the user and allow it to either report
- * the execption or ignore it.
+ * the exception or ignore it.
  *
  * @author Michael Zangl
Index: /trunk/src/org/openstreetmap/josm/tools/bugreport/ReportedException.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/bugreport/ReportedException.java	(revision 10585)
+++ /trunk/src/org/openstreetmap/josm/tools/bugreport/ReportedException.java	(revision 10586)
@@ -17,4 +17,5 @@
 import java.util.NoSuchElementException;
 import java.util.Set;
+import java.util.function.Supplier;
 
 import org.openstreetmap.josm.Main;
@@ -180,5 +181,5 @@
 
     /**
-     * Adds some debug values to this exception.
+     * Adds some debug values to this exception. The value is converted to a string. Errors during conversion are handled.
      *
      * @param key
@@ -189,6 +190,21 @@
      */
     public ReportedException put(String key, Object value) {
+        return put(key, () -> value);
+    }
+
+    /**
+    * Adds some debug values to this exception. This method automatically catches errors that occur during the production of the value.
+    *
+    * @param key
+    *            The key to add this for. Does not need to be unique but it would be nice.
+    * @param valueSupplier
+    *            A supplier that is called once to get the value.
+    * @return This exception for easy chaining.
+    * @since 10586
+    */
+    public ReportedException put(String key, Supplier<Object> valueSupplier) {
         String string;
         try {
+            Object value = valueSupplier.get();
             if (value == null) {
                 string = "null";
