Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#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  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.tools.bugreport;
    33
     4import org.openstreetmap.josm.Main;
     5
    46/**
    57 * An exception handler that asks the user to send a bug report.
    68 *
    public void uncaughtException(Thread t, Throwable e) { 
    1921     * @param e the exception
    2022     */
    2123    public static synchronized void handleException(final Throwable e) {
     24        Main.error(e);
    2225        BugReport.intercept(e).warn();
    2326    }
    2427

Attachments (0)

Change History (4)

comment:1 Changed 4 years ago by bastiK

+1, the stack trace should be dumped to the command line.

comment:2 Changed 4 years ago by michael2402

+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);

comment:3 Changed 4 years ago by simon04

Resolution: fixed
Status: newclosed

In 11180/josm:

fix #13850 - Exceptions handled via BugReport are no longer written to the console

comment:4 Changed 4 years ago by simon04

In 11211/josm:

see #13850 - BugReportQueue output original exception to console

Make it consistent with report sent to Trac.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain michael2402.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.