HDException Class Reference

Generic HepData exception: may be a wrapper round another exception. More...

Inheritance diagram for HDException:

Inheritance graph
[legend]

List of all members.


Public Member Functions

 HDException (Exception originalException)
 HDException constructor wrapping underlying exception.
 HDException (Exception originalException, String msg)
 HDException constructor wrapping underlying exception.
 HDException (String message, String data)
 HDException constructor when no underlying exception thrown.
 HDException (String message)
 HDException constructor from a string.
 HDException ()
 HDException default constructor.
void printStackTrace (PrintWriter printWriter)
 This prints the original exception stack trace, if there is one.
void printStackTrace (PrintStream printStream)
 This prints the original exception stack trace, if there is one.
String getMessage ()
 Shows the sql error details (if relevant), and error data (if supplied).
Exception getOriginalException ()
 gets the original exception this exception wraps

Detailed Description

Generic HepData exception: may be a wrapper round another exception.

Author:
S. Butterworth
Version:
Date
2006-07-12 15:34:50 +0100 (Wed, 12 Jul 2006)
Revision
640

Definition at line 13 of file HDException.java.


Constructor & Destructor Documentation

HDException ( Exception  originalException  ) 

HDException constructor wrapping underlying exception.

Parameters:
originalException 

Definition at line 22 of file HDException.java.

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

HDException ( Exception  originalException,
String  msg 
)

HDException constructor wrapping underlying exception.

Parameters:
originalException 
msg 

Definition at line 33 of file HDException.java.

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

HDException ( String  message,
String  data 
)

HDException constructor when no underlying exception thrown.

Parameters:
message 
data useful in debugging this error

Definition at line 44 of file HDException.java.

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

HDException ( String  message  ) 

HDException constructor from a string.

Parameters:
message 

Definition at line 54 of file HDException.java.

00054                                        {
00055         super(message);
00056     }

HDException (  ) 

HDException default constructor.

Definition at line 61 of file HDException.java.

00061                          {
00062         super("Generic HepData exception");
00063     }


Member Function Documentation

void printStackTrace ( PrintWriter  printWriter  ) 

This prints the original exception stack trace, if there is one.

The message and stack trace can be obtained from it.

Parameters:
printWriter 

Definition at line 71 of file HDException.java.

00071                                                          {
00072         if (originalException != null) {
00073             originalException.printStackTrace(printWriter);
00074         } else {
00075             super.printStackTrace(printWriter);
00076         }
00077     }

void printStackTrace ( PrintStream  printStream  ) 

This prints the original exception stack trace, if there is one.

The message and stack trace can be obtained from it.

Parameters:
printStream 

Definition at line 85 of file HDException.java.

00085                                                          {
00086         if (originalException != null) {
00087             originalException.printStackTrace(printStream);
00088         } else {
00089             super.printStackTrace(printStream);
00090         }
00091     }

String getMessage (  ) 

Shows the sql error details (if relevant), and error data (if supplied).

Returns:
error message

Definition at line 99 of file HDException.java.

00099                                {
00100         StringBuffer b = new StringBuffer();
00101 
00102         //b.append(this.getClass().getName());
00103         //b.append("\n");
00104         b.append(super.getMessage());
00105 
00106         //if (originalException!=null){a
00107         //    b.append("\n Original Exception\n");
00108         //    b.append(originalException.getClass().getName());
00109         //  }
00110         //printStackTrace(System.out);
00111         if (data != "") {
00112             b.append(":DATA:");
00113             b.append(data);
00114         }
00115 
00116         return b.toString();
00117     }

Exception getOriginalException (  ) 

gets the original exception this exception wraps

Returns:
exception

Definition at line 124 of file HDException.java.

00124                                             {
00125         return originalException;
00126     }


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


Generated on Tue Apr 21 15:54:56 2009 for HepData common classes by  doxygen 1.5.5