#13850 closed defect (fixed)
[Patch] Exceptions handled via BugReport are no longer written to the console
Reported by: | simon04 | Owned by: | michael2402 |
---|---|---|---|
Priority: | minor | Milestone: | 16.10 |
Component: | Core | Version: | |
Keywords: | Cc: |
Description
For instance, the exception from #13828 is handled via the BugReport queue, but is not written to the console. This prevents from easily inspecting the stack trace when running JOSM from an IDE.
What about the fix:
-
src/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandler.java
diff --git a/src/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandler.java b/src/org/openstreetmap/josm/tools/bugreport/BugReportExceptionHandler.java index 1decdd1..538a2cc 100644
a b 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.tools.bugreport; 3 3 4 import org.openstreetmap.josm.Main; 5 4 6 /** 5 7 * An exception handler that asks the user to send a bug report. 6 8 * … … public void uncaughtException(Thread t, Throwable e) { 19 21 * @param e the exception 20 22 */ 21 23 public static synchronized void handleException(final Throwable e) { 24 Main.error(e); 22 25 BugReport.intercept(e).warn(); 23 26 } 24 27
Attachments (0)
Change History (4)
comment:1 by , 8 years ago
comment:2 by , 8 years ago
+1
You can use Logging.logWithStackTrace(Logging.LEVEL_ERROR, "Handled by bug report queue", e);
to add a message and a stack trace (which is not possible with the Main methods).
I would suggest to move this call to the BugReportQueue#submit()
method. There are log statements for the skipped errors - we could add stack traces to those, too. We can even add the stack traces in a more verbose level only, like:
Logging.info("User requested to skip error {0}", report); Logging.logWithStackTrace(Logging.LEVEL_DEBUG, e);
+1, the stack trace should be dumped to the command line.