-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRTMLException.java
More file actions
128 lines (114 loc) · 3.44 KB
/
RTMLException.java
File metadata and controls
128 lines (114 loc) · 3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/*
Copyright 2006, Astrophysics Research Institute, Liverpool John Moores University.
This file is part of org.estar.rtml.
org.estar.rtml is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
org.estar.rtml is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with org.estar.rtml; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// RTMLException.java
// $Header: /space/home/eng/cjm/cvs/org_estar_rtml/RTMLException.java,v 1.4 2008-05-27 14:11:45 cjm Exp $
package org.estar.rtml;
import java.io.*;
/**
* This class extends Exception.
* @author Chris Mottram
* @version $Revision$
*/
public class RTMLException extends Exception
{
/**
* Revision Control System id string, showing the version of the Class
*/
public final static String RCSID = new String("$Id$");
/**
* Serial version ID. Fixed as these documents can be used as parameters in RMI calls across JVMs.
*/
static final long serialVersionUID = -8256433613564970665L;
/**
* An exception that caused this exception to be generated.
*/
private Exception exception = null;
/**
* Constructor for the exception.
* @param errorString The error string.
*/
public RTMLException(String errorString)
{
super(errorString);
}
/**
* Constructor for the exception.
* @param errorString The error string.
* @param e An exception that caused this exception to be generated.
*/
public RTMLException(String errorString,Exception e)
{
super(errorString);
exception = e;
}
/**
* Retrieve method to return exception that generated this exception.
* @return An exception, or null.
* @see #exception
*/
public Exception getException()
{
return exception;
}
/**
* Overridden toString method, that calls super toString and adds exception's toString to it.
*/
public String toString()
{
StringBuffer sb = null;
sb = new StringBuffer();
sb.append(super.toString());
if(exception != null)
sb.append(exception.toString());
return sb.toString();
}
/**
* Overridden printStackTrace, that prints the creating exceptions stack if it is non-null.
* NB Logger.dumpStack uses this method.
* @param s The writer to write to.
*/
public void printStackTrace(PrintWriter s)
{
super.printStackTrace(s);
if(exception != null)
exception.printStackTrace(s);
}
/**
* Overridden printStackTrace, that prints the creating exceptions stack if it is non-null.
* NB printStackTrace() uses this method.
* @param s The stream to write to.
*/
public void printStackTrace(PrintStream s)
{
super.printStackTrace(s);
if(exception != null)
exception.printStackTrace(s);
}
}
//
// $Log: not supported by cvs2svn $
// Revision 1.3 2007/01/30 18:31:15 cjm
// gnuify: Added GNU General Public License.
//
// Revision 1.2 2005/06/08 11:14:01 cjm
// Fixed Documentation.
// Removed spurious errorString.
// Fixed printStackTrace for dumpStack and printStackTrace() compatibility.
//
// Revision 1.1 2003/02/24 13:19:56 cjm
// Initial revision
//
//