Index: /trunk/src/org/openstreetmap/josm/tools/bugreport/BugReport.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/bugreport/BugReport.java	(revision 10885)
+++ /trunk/src/org/openstreetmap/josm/tools/bugreport/BugReport.java	(revision 10886)
@@ -123,5 +123,9 @@
         PrintWriter out = new PrintWriter(stringWriter);
         if (isIncludeStatusReport()) {
-            out.println(ShowStatusReportAction.getReportHeader());
+            try {
+                out.println(ShowStatusReportAction.getReportHeader());
+            } catch (RuntimeException e) {
+                out.println("Could not generate status report: " + e.getMessage());
+            }
         }
         if (isIncludeData()) {
Index: /trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportQueue.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportQueue.java	(revision 10885)
+++ /trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportQueue.java	(revision 10886)
@@ -5,5 +5,7 @@
 import java.util.ArrayList;
 import java.util.LinkedList;
+import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.function.BiFunction;
+import java.util.function.Predicate;
 
 import org.openstreetmap.josm.Main;
@@ -23,4 +25,5 @@
     private Thread displayThread;
     private final BiFunction<ReportedException, Integer, SuppressionMode> bugReportHandler = getBestHandler();
+    private final CopyOnWriteArrayList<Predicate<ReportedException>> handlers = new CopyOnWriteArrayList<>();
     private int displayedErrors;
 
@@ -97,4 +100,8 @@
 
     private SuppressionMode displayFor(ReportedException e) {
+        if (handlers.stream().anyMatch(p -> p.test(e))) {
+            Main.trace("Intercepted by handler.");
+            return SuppressionMode.NONE;
+        }
         return bugReportHandler.apply(e, getDisplayedErrors());
     }
@@ -123,4 +130,18 @@
     }
 
+    /**
+     * Allows you to peek or even intersect the bug reports.
+     * @param handler The handler. It can return false to stop all further handling of the exception.
+     * @since 10886
+     */
+    public void addBugReportHandler(Predicate<ReportedException> handler) {
+        handlers.add(handler);
+    }
+
+    /**
+     * Gets the global bug report queue
+     * @return The queue
+     * @since 10886
+     */
     public static BugReportQueue getInstance() {
         return INSTANCE;
Index: /trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandlerTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandlerTest.java	(revision 10885)
+++ /trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandlerTest.java	(revision 10886)
@@ -2,9 +2,11 @@
 package org.openstreetmap.josm.tools.bugreport;
 
-import static org.junit.Assert.assertFalse;
+import java.util.concurrent.CountDownLatch;
 
-import org.junit.Before;
+import org.junit.Rule;
 import org.junit.Test;
-import org.openstreetmap.josm.JOSMFixture;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
 /**
@@ -12,20 +14,21 @@
  */
 public class BugReportExceptionHandlerTest {
-
     /**
-     * Setup tests.
+     * No dependencies
      */
-    @Before
-    public void setUp() {
-        JOSMFixture.createUnitTestFixture().init(true);
-    }
+    @Rule
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
+    public JOSMTestRules test = new JOSMTestRules();
 
     /**
      * Unit test for {@link BugReportExceptionHandler#handleException} method.
+     * @throws InterruptedException if the current thread is interrupted while waiting
      */
     @Test
-    public void testHandleException() {
+    public void testHandleException() throws InterruptedException {
+        CountDownLatch latch = new CountDownLatch(1);
+        BugReportQueue.getInstance().addBugReportHandler(e -> {latch.countDown(); return false;});
         BugReportExceptionHandler.handleException(new Exception("testHandleException"));
-        assertFalse(BugReportExceptionHandler.exceptionHandlingInProgress());
+        latch.await();
     }
 }
Index: /trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportTest.java	(revision 10885)
+++ /trunk/test/unit/org/openstreetmap/josm/tools/bugreport/BugReportTest.java	(revision 10886)
@@ -3,13 +3,64 @@
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
 
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import org.junit.Rule;
 import org.junit.Test;
+import org.openstreetmap.josm.testutils.JOSMTestRules;
+
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
 /**
  * Tests the bug report class.
  * @author Michael Zangl
- * @since 10285
  */
 public class BugReportTest {
+    /**
+     * Preferences for the report text
+     */
+    @Rule
+    @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
+    public JOSMTestRules test = new JOSMTestRules().preferences();
+
+    /**
+     * Test {@link BugReport#getReportText()}
+     */
+    @Test
+    public void testReportText() {
+        ReportedException e = interceptInChildMethod(new IOException("test-exception-message"));
+        e.put("test-key", "test-value");
+        String text = new BugReport(e).getReportText();
+
+        assertTrue(text.contains("test-exception-message"));
+        assertTrue(text.contains("interceptInChildMethod"));
+        assertTrue(text.contains("testReportText")); // stack trace
+        assertTrue(text.contains("test-key: test-value"));
+    }
+
+    /**
+     * Test {@link BugReport#intercept(Throwable)}
+     */
+    @Test
+    public void testIntercept() {
+        IOException base = new IOException("test");
+        ReportedException intercepted = interceptInChildMethod(base);
+        assertEquals(intercepted.getCause(), base);
+
+        StringWriter out = new StringWriter();
+        intercepted.printReportDataTo(new PrintWriter(out));
+
+        assertTrue(out.toString().contains("interceptInChildMethod")); // calling method.
+
+        assertSame(intercepted, BugReport.intercept(intercepted));
+    }
+
+    private ReportedException interceptInChildMethod(IOException base) {
+        return BugReport.intercept(base);
+    }
 
     /**
@@ -20,4 +71,5 @@
         assertEquals("BugReportTest#testGetCallingMethod", BugReport.getCallingMethod(1));
         assertEquals("BugReportTest#testGetCallingMethod", testGetCallingMethod2());
+        assertEquals("?", BugReport.getCallingMethod(100));
     }
 
