diff --git a/src/org/openstreetmap/josm/gui/progress/swing/ProgressMonitorExecutor.java b/src/org/openstreetmap/josm/gui/progress/swing/ProgressMonitorExecutor.java
index 2a4a84765f..d0b04127a2 100644
a
|
b
|
|
1 | 1 | // License: GPL. For details, see LICENSE file. |
2 | 2 | package org.openstreetmap.josm.gui.progress.swing; |
3 | 3 | |
| 4 | import java.awt.GraphicsEnvironment; |
4 | 5 | import java.util.concurrent.CancellationException; |
5 | 6 | import java.util.concurrent.ExecutionException; |
6 | 7 | import java.util.concurrent.Future; |
… |
… |
import java.util.concurrent.TimeUnit;
|
10 | 11 | |
11 | 12 | import org.openstreetmap.josm.tools.Logging; |
12 | 13 | import org.openstreetmap.josm.tools.Utils; |
| 14 | import org.openstreetmap.josm.tools.bugreport.BugReport; |
13 | 15 | |
14 | 16 | /** |
15 | 17 | * Executor that displays the progress monitor to the user. |
… |
… |
public class ProgressMonitorExecutor extends ThreadPoolExecutor {
|
58 | 60 | } |
59 | 61 | if (t != null) { |
60 | 62 | Logging.error("Thread {0} raised {1}", Thread.currentThread().getName(), t); |
| 63 | // Assume that a no graphics environment should *always* print the stack trace (these are almost always |
| 64 | // test environments). Also log if trace is enabled. |
| 65 | if (GraphicsEnvironment.isHeadless() || Logging.isDebugEnabled()) { |
| 66 | Logging.error(t); |
| 67 | } |
| 68 | // For now, only show the user bug report windows when debug is enabled |
| 69 | if (Logging.isDebugEnabled() || Utils.isRunningWebStart()) { |
| 70 | BugReport.intercept(t).warn(); |
| 71 | } |
61 | 72 | } |
62 | 73 | } |
63 | 74 | } |