Main Page | Packages | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

JetWebException Class Reference

Inheritance diagram for JetWebException:

Inheritance graph
[legend]
List of all members.

Detailed Description

Generic exception thrown by JetWeb application. This exception originates from the JetWeb control layer. May be a wrapper round another exception.

Author:
S. Butterworth
Version:
Date
2005-10-24 10:16:06 +0100 (Mon, 24 Oct 2005)
Revision
959

Definition at line 14 of file JetWebException.java.


Public Member Functions

 JetWebException (Exception originalException)
 JetWebException (Exception originalException, String msg)
 JetWebException (String message, String datain)
void printStackTrace (PrintWriter s)
void printStackTrace (PrintStream s)
String getMessage ()
Exception getOriginalException ()

Protected Attributes

String data = ""
Exception originalException

Constructor & Destructor Documentation

JetWebException Exception  originalException  ) 
 

JetWebException constructor wrapping underlying exception.

Parameters:
originalException 

Definition at line 23 of file JetWebException.java.

00023                                                        {
00024     super(originalException.getMessage());
00025     this.originalException = originalException;
00026     } 

JetWebException Exception  originalException,
String  msg
 

JetWebException constructor wrapping underlying exception.

Parameters:
originalException 
msg 

Definition at line 33 of file JetWebException.java.

00033                                                                    {
00034     super(msg +" "+ originalException.getMessage());
00035     this.originalException = originalException;
00036     } 

JetWebException String  message,
String  datain
 

JetWebException constructor when no underlying exception thrown.

Parameters:
message 
data useful in debugging this error

Definition at line 43 of file JetWebException.java.

00043                                                          {
00044     super(message);
00045     this.data = datain;
00046     } 


Member Function Documentation

String getMessage  ) 
 

Overrides super to show the sql error details (if relevant), and error data (if supplied)

Returns:
error message

Reimplemented in JetWebDBException, and JobRequestException.

Definition at line 80 of file JetWebException.java.

References JetWebException.data, and JetWebException.originalException.

00080                               {
00081     
00082     StringBuffer b = new StringBuffer();
00083     b.append(this.getClass().getName());
00084     b.append("\n");
00085         b.append(super.getMessage()); 
00086 
00087     if (originalException!=null){
00088         b.append("\n Original Exception\n");
00089         b.append(originalException.getClass().getName());
00090     }
00091 
00092     //printStackTrace(System.out);
00093 
00094         if (!data.equals("")){
00095         b.append("\n:DATA:");
00096         b.append(data);
00097     }
00098     
00099     return b.toString();
00100     
00101     }

Exception getOriginalException  ) 
 

gets the original exception this exception wraps

Returns:
exception

Definition at line 107 of file JetWebException.java.

Referenced by JobRequestException.getMessage(), and JetWebDBException.getMessage().

00107                                            {
00108     return originalException;
00109     }

void printStackTrace PrintStream  s  ) 
 

This overrides super to print the original exception stack trace, if there is one. The message and stack trace can be obtained from it.

Parameters:
PrintStream 

Definition at line 67 of file JetWebException.java.

References JetWebException.originalException.

00067                                               {
00068     if (originalException!=null){
00069         originalException.printStackTrace(s);
00070     } else {
00071         super.printStackTrace(s);
00072     }
00073     }

void printStackTrace PrintWriter  s  ) 
 

This overrides super to print the original exception stack trace, if there is one. The message and stack trace can be obtained from it.

Parameters:
PrintWriter 

Definition at line 54 of file JetWebException.java.

References JetWebException.originalException.

00054                                               {
00055     if (originalException!=null){
00056         originalException.printStackTrace(s);
00057     } else {
00058         super.printStackTrace(s);
00059     }
00060     }


Member Data Documentation

String data = "" [protected]
 

Definition at line 16 of file JetWebException.java.

Referenced by JetWebException.getMessage().

Exception originalException [protected]
 

Definition at line 17 of file JetWebException.java.

Referenced by JetWebException.getMessage(), and JetWebException.printStackTrace().


The documentation for this class was generated from the following file:

Generated Wed Jan 17 09:14:27 GMT 2007