Index: trunk/src/org/openstreetmap/josm/gui/MainApplication.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 12769)
+++ trunk/src/org/openstreetmap/josm/gui/MainApplication.java	(revision 12770)
@@ -88,4 +88,5 @@
 import org.openstreetmap.josm.gui.ProgramArguments.Option;
 import org.openstreetmap.josm.gui.SplashScreen.SplashProgressMonitor;
+import org.openstreetmap.josm.gui.bugreport.BugReportDialog;
 import org.openstreetmap.josm.gui.download.DownloadDialog;
 import org.openstreetmap.josm.gui.io.CustomConfigurator.XMLCommandProcessor;
@@ -143,4 +144,5 @@
 import org.openstreetmap.josm.tools.bugreport.BugReport;
 import org.openstreetmap.josm.tools.bugreport.BugReportExceptionHandler;
+import org.openstreetmap.josm.tools.bugreport.BugReportQueue;
 import org.xml.sax.SAXException;
 
@@ -754,4 +756,8 @@
         }
 
+        if (!GraphicsEnvironment.isHeadless()) {
+            BugReportQueue.getInstance().setBugReportHandler(BugReportDialog::showFor);
+        }
+
         Level logLevel = args.getLogLevel();
         Logging.setLogLevel(logLevel);
Index: trunk/src/org/openstreetmap/josm/gui/bugreport/DebugTextDisplay.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/bugreport/DebugTextDisplay.java	(revision 12769)
+++ trunk/src/org/openstreetmap/josm/gui/bugreport/DebugTextDisplay.java	(revision 12770)
@@ -6,4 +6,5 @@
 import javax.swing.JScrollPane;
 
+import org.openstreetmap.josm.actions.ShowStatusReportAction;
 import org.openstreetmap.josm.gui.datatransfer.ClipboardUtils;
 import org.openstreetmap.josm.gui.widgets.JosmTextArea;
@@ -49,6 +50,6 @@
     public DebugTextDisplay(BugReport report) {
         this();
-        setCodeText(report.getReportText());
-        report.addChangeListener(e -> setCodeText(report.getReportText()));
+        setCodeText(report.getReportText(ShowStatusReportAction.getReportHeader()));
+        report.addChangeListener(e -> setCodeText(report.getReportText(ShowStatusReportAction.getReportHeader())));
     }
 
Index: trunk/src/org/openstreetmap/josm/tools/bugreport/BugReport.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/bugreport/BugReport.java	(revision 12769)
+++ trunk/src/org/openstreetmap/josm/tools/bugreport/BugReport.java	(revision 12770)
@@ -7,6 +7,4 @@
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.function.Predicate;
-
-import org.openstreetmap.josm.actions.ShowStatusReportAction;
 
 /**
@@ -21,5 +19,5 @@
  * <p>
  * 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
+ * or other local variables. Make sure that no exceptions may occur while computing the values. It is best to send plain local variables to
  * 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.
@@ -117,13 +115,14 @@
     /**
      * Gets the full string that should be send as error report.
+     * @param header header text for the error report
      * @return The string.
      * @since 10585
      */
-    public String getReportText() {
+    public String getReportText(String header) {
         StringWriter stringWriter = new StringWriter();
         PrintWriter out = new PrintWriter(stringWriter);
         if (isIncludeStatusReport()) {
             try {
-                out.println(ShowStatusReportAction.getReportHeader());
+                out.println(header);
             } catch (RuntimeException e) { // NOPMD
                 out.println("Could not generate status report: " + e.getMessage());
Index: trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportQueue.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportQueue.java	(revision 12769)
+++ trunk/src/org/openstreetmap/josm/tools/bugreport/BugReportQueue.java	(revision 12770)
@@ -2,12 +2,9 @@
 package org.openstreetmap.josm.tools.bugreport;
 
-import java.awt.GraphicsEnvironment;
 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.gui.bugreport.BugReportDialog;
 import org.openstreetmap.josm.tools.Logging;
 
@@ -21,13 +18,31 @@
     private static final BugReportQueue INSTANCE = new BugReportQueue();
 
+    public static final BugReportHandler FALLBACK_BUGREPORT_HANDLER = (e, index) -> {
+        e.printStackTrace();
+        return BugReportQueue.SuppressionMode.NONE;
+    };
+
     private final LinkedList<ReportedException> reportsToDisplay = new LinkedList<>();
     private boolean suppressAllMessages;
     private final ArrayList<ReportedException> suppressFor = new ArrayList<>();
     private Thread displayThread;
-    private final BiFunction<ReportedException, Integer, SuppressionMode> bugReportHandler = getBestHandler();
+    private BugReportHandler bugReportHandler = FALLBACK_BUGREPORT_HANDLER;
     private final CopyOnWriteArrayList<Predicate<ReportedException>> handlers = new CopyOnWriteArrayList<>();
     private int displayedErrors;
 
     private boolean inReportDialog;
+
+    /**
+     * Class that handles reporting a bug to the user.
+     */
+    public interface BugReportHandler {
+        /**
+         * Handle the bug report for a given exception
+         * @param e The exception to display
+         * @param exceptionCounter A counter of how many exceptions have already been worked on
+         * @return The new suppression status
+         */
+        SuppressionMode handle(ReportedException e, int exceptionCounter);
+    }
 
     /**
@@ -112,5 +127,5 @@
             return SuppressionMode.NONE;
         }
-        return bugReportHandler.apply(e, getDisplayedErrors());
+        return bugReportHandler.handle(e, getDisplayedErrors());
     }
 
@@ -127,17 +142,10 @@
     }
 
-    private static BiFunction<ReportedException, Integer, SuppressionMode> getBestHandler() {
-        if (GraphicsEnvironment.isHeadless()) {
-            return (e, index) -> {
-                e.printStackTrace();
-                return SuppressionMode.NONE;
-            };
-        } else {
-            return BugReportDialog::showFor;
-        }
+    public void setBugReportHandler(BugReportHandler bugReportHandler) {
+        this.bugReportHandler = bugReportHandler;
     }
 
     /**
-     * Allows you to peek or even intersect the bug reports.
+     * Allows you to peek or even intercept the bug reports.
      * @param handler The handler. It can return false to stop all further handling of the exception.
      * @since 10886
