KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nightlabs > rcp > exceptionhandler > wizard > ThrowableHandler


1 /*
2  * Created on 05.04.2005
3  */

4 package com.nightlabs.rcp.exceptionhandler.wizard;
5
6 import org.apache.log4j.Logger;
7
8 import com.nightlabs.rcp.exceptionhandler.IExceptionHandler;
9 import com.nightlabs.rcp.wizard.DynamicPathWizardDialog;
10
11 /**
12  * @author Simon Lehmann - simon@nightlabs.de
13  */

14 public class ThrowableHandler implements IExceptionHandler
15 {
16     public static final Logger LOGGER = Logger.getLogger(ThrowableHandler.class);
17     /**
18      * @see com.nightlabs.rcp.exceptionhandler.IExceptionHandler#handleException(java.lang.Thread, java.lang.Throwable, java.lang.Throwable)
19      */

20     public void handleException(Thread JavaDoc thread, Throwable JavaDoc thrownException,
21             Throwable JavaDoc triggerException)
22     {
23         try {
24             LOGGER.error("ThrowableHandler handling an error!", thrownException);
25
26             ErrorReport errorReport = new ErrorReport(thrownException, triggerException);
27             //errorReport.setTriggerException(triggerException);
28
ExceptionHandlerWizard wizard = new ExceptionHandlerWizard(errorReport);
29             DynamicPathWizardDialog dialog = new DynamicPathWizardDialog(wizard);
30             dialog.setTitle("An error occured!");
31             dialog.open();
32         } catch (Throwable JavaDoc hanspeter) {
33             LOGGER.fatal("While handling an exception, another one occured!", hanspeter);
34         }
35     }
36
37 // public ErrorReport getErrorReport()
38
// {
39
// return errorReport;
40
// }
41
}
42
Popular Tags