Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Job Exception catching
Job Exception catching [message #437821] Wed, 05 October 2005 14:24 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Job Exception catching [message #437926 is a reply to message #437821] Fri, 07 October 2005 15:49 Go to previous message
John Arthorne is currently offline John ArthorneFriend
Messages: 176
Registered: July 2009
Senior Member
How about this:

Platform.getJobManager().addJobChangeListener(new JobChangeAdapter(){
public void done(IJobChangeEvent event) {
if (event.getResult().getSeverity() == IStatus.ERROR)
//add error handling code here
}
});

I agree that if you want to change the UI presentation of errors, you
will need to hook into the UI's progress manager.
--


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
Previous Topic:JavaFileEditorInput is used as default for File Open gesture.
Next Topic:need help with a perspective/view problem
Goto Forum:
  


Current Time: Sun Dec 08 21:32:40 GMT 2024

Powered by FUDForum. Page generated in 0.03492 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top