KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jzonic > jlo > error > ErrorHandler


1 package org.jzonic.jlo.error;
2 /**
3  * The ErrorHandler is used when an exception occurs in the framework. The
4  * exception must not be thrown back to the application that uses jLo.
5  * Therefore we use our own ErrorHandler that sends the Exception together with
6  * a message to System.out.
7  *
8  *@author Andreas Mecky
9  *@author Terry Dye
10  *@created 9. März 2002
11  *@version 1.0
12  */

13 public class ErrorHandler {
14     /**
15      * Constructor for the ErrorHandler object
16      */

17     public ErrorHandler() { }
18
19
20     /**
21      * This method writes a message
22      *
23      *@param message the message that will be written to System.out
24      */

25     public static void reportError(String JavaDoc message) {
26         ErrorHandlerFactory.getErrorReporter().reportError(message);
27     }
28
29
30     /**
31      * This method writes a message together with the StackTrace from the
32      * exception
33      *
34      *@param message the message that will be written
35      *@param thrown the excption
36      */

37     public static void reportError(String JavaDoc message, Throwable JavaDoc thrown) {
38         ErrorHandlerFactory.getErrorReporter().reportError(message,thrown);
39     }
40
41
42     /**
43      * This method writes the StackTrace from the exception
44      *
45      *@param thrown the excption
46      */

47     public static void reportError(Throwable JavaDoc thrown) {
48         ErrorHandlerFactory.getErrorReporter().reportError(thrown);
49     }
50 }
51
Popular Tags