Modify

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#4524 closed defect (fixed)

Exception handling in PleaseWaitRunnable

Reported by: bastiK Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: Cc:

Description

In the PleaseWaitRunnable code the parameter ignoreException has the description If true, exception will be propagated to calling code.

However this is not true, the Exceptions are really ignored, i.e. simply dropped. The following code demonstrates the problem: It does not lead to any visible Exception.

    Main.worker.submit(new Runnable() {
        public final void run() {
            throw new RuntimeException();
       }
    });

In this thread they have a view ways to catch exceptions in such a case:
http://stackoverflow.com/questions/1687977/how-to-properly-catch-runtimeexceptions-from-executors

Currently we catch all exceptions inside the Runnable. There are two kinds of Exceptions: (1) Errors that are expected (Parse error, io error) and (2) Coding errors. (1) should lead to a simple message box and (2) should open the bug report window.

Currently this is not the case: All errors except RuntimeException get a simple message box.

Attachments (0)

Change History (4)

in reply to:  description ; comment:1 by anonymous, 15 years ago

The comment also says - When this runnable is executed using executor framework then use false unless you read result of task (because exception will get lost if you don't).

If ignoreException is set to false, exception will be caught and rethrown in EDT.

in reply to:  1 comment:2 by bastiK, 15 years ago

Replying to anonymous:

The comment also says - When this runnable is executed using executor framework then use false unless you read result of task (because exception will get lost if you don't).

First part I agree.

If ignoreException is set to false, exception will be caught and rethrown in EDT.

Maybe this used to be the case, but currently it just shows a message box:

line 127:
            // Exception has to thrown in EDT to be shown to user
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    ExceptionDialogUtil.explainException(ex);
                }
            });

comment:3 by jttt, 15 years ago

Resolution: fixed
Status: newclosed

(In [2984]) Fix #4524 Exception handling in PleaseWaitRunnable

comment:4 by jttt, 15 years ago

I've changed it in ExceptionDialogUtil to show bug report dialog when unknown exception is thrown.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.