Job Exception catching [message #437821] |
Wed, 05 October 2005 14:24 |
Eclipse User |
|
|
|
Originally posted by: fleque.users.nospam.sf.net
Hi all,
we added a custom exception handler to a RCP application. It is handling
exceptions from uncaught EventLoop Exceptions and those thrown within
ISaveRunnables. I wondered if there is a way to intercept exceptions
that are thrown within a Job, too? I've seen that
org.eclipse.ui.internal.progress.ProgressManager holds an instance of
ErrorNotificationManager that is responsible of displaying errors within
Jobs to the user.
For ISafeRunnables it is possible to set the runner by
SafeRunnable.setRunner(ISaveRunnableRunner);
Are there plans to provide such a similar possibility for the
ProgressService in Eclipse. Something like
IProgressService.setErrorNotifcationManager(IJobErrorNotific ationManager)
would be great ...
Regards Alex
|
|
|
Re: Job Exception catching [message #437835 is a reply to message #437821] |
Wed, 05 October 2005 15:48 |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
Fleque wrote:
> Hi all,
>
> we added a custom exception handler to a RCP application. It is handling
> exceptions from uncaught EventLoop Exceptions and those thrown within
> ISaveRunnables. I wondered if there is a way to intercept exceptions
> that are thrown within a Job, too? I've seen that
> org.eclipse.ui.internal.progress.ProgressManager holds an instance of
> ErrorNotificationManager that is responsible of displaying errors within
> Jobs to the user.
> For ISafeRunnables it is possible to set the runner by
> SafeRunnable.setRunner(ISaveRunnableRunner);
> Are there plans to provide such a similar possibility for the
> ProgressService in Eclipse. Something like
> IProgressService.setErrorNotifcationManager(IJobErrorNotific ationManager)
> would be great ...
>
> Regards Alex
you can join() the job and get the return value from it after it
executes. But I find this is not good since if the job throws an
exception it will already have been displayed to the user.
If you need to fashion a user friendly statement from the job you need
to be careful of the type of exception you throw in the job, or rather
carerful of the Status you return from a failed job.
Outside of that is much easier if you fashion you program to only care
about whether the job finished OK or not.
CL
|
|
|
Re: Job Exception catching [message #437918 is a reply to message #437835] |
Thu, 06 October 2005 21:54 |
Eclipse User |
|
|
|
Originally posted by: fleque.users.nospam.sf.net
Hi,
thanks for your reply ... I could not find a really good solution
neither, so I've opened an enhancement request:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=111852
Regards Alex
CL [dnoyeb] Gilbert wrote:
>
>
> you can join() the job and get the return value from it after it
> executes. But I find this is not good since if the job throws an
> exception it will already have been displayed to the user.
>
> If you need to fashion a user friendly statement from the job you need
> to be careful of the type of exception you throw in the job, or rather
> carerful of the Status you return from a failed job.
>
> Outside of that is much easier if you fashion you program to only care
> about whether the job finished OK or not.
>
>
> CL
|
|
|
|
Powered by
FUDForum. Page generated in 0.03492 seconds