#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)
follow-up: 2 comment:1 by , 15 years ago
comment:2 by , 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 , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 15 years ago
I've changed it in ExceptionDialogUtil to show bug report dialog when unknown exception is thrown.
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.