01: package org.jzonic.jlo.error;
02:
03: /**
04: * The ErrorHandler is used when an exception occurs in the framework. The
05: * exception must not be thrown back to the application that uses jLo.
06: * Therefore we use our own ErrorHandler that sends the Exception together with
07: * a message to System.out.
08: *
09: *@author Andreas Mecky
10: *@author Terry Dye
11: *@created 9. März 2002
12: *@version 1.0
13: */
14: public class ErrorHandler {
15: /**
16: * Constructor for the ErrorHandler object
17: */
18: public ErrorHandler() {
19: }
20:
21: /**
22: * This method writes a message
23: *
24: *@param message the message that will be written to System.out
25: */
26: public static void reportError(String message) {
27: ErrorHandlerFactory.getErrorReporter().reportError(message);
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 message, Throwable thrown) {
38: ErrorHandlerFactory.getErrorReporter().reportError(message,
39: thrown);
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 thrown) {
48: ErrorHandlerFactory.getErrorReporter().reportError(thrown);
49: }
50: }
|