01: /*
02: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05: package com.sun.portal.taskadmin.taglib;
06:
07: import java.lang.Throwable;
08: import java.io.PrintStream;
09: import java.io.PrintWriter;
10: import javax.servlet.jsp.JspException;
11:
12: public class TaskAdminTaglibException extends JspException {
13:
14: static public final int INVALID_TAG_SEQUENCE = 0;
15: static public final int INIT_FAILED = 1;
16: static public final int INVALID_PARAMETER = 2;
17: static public final int UNDEFINED_PARAMETER = 3;
18: static public final int EMPTY_CONTEXT = 4;
19:
20: static private final String exceptionMsg[] = {
21: "Invalid Tag Sequence : ",
22: "TaskAdmin Initialization Failed :",
23: "Invalid Parameter : ",
24: "Variable Undefined in Page Context : ",
25: "Taglib Context is empty : " };
26:
27: private Throwable wrapped = null;
28:
29: public TaskAdminTaglibException(String msg) {
30: super (msg);
31: }
32:
33: public TaskAdminTaglibException(int type, String additionalMsg) {
34: super (exceptionMsg[type] + additionalMsg);
35: }
36:
37: public TaskAdminTaglibException(int type) {
38: super (exceptionMsg[type]);
39: }
40:
41: public TaskAdminTaglibException(Throwable t) {
42: super (t.getMessage());
43: wrapped = t;
44: }
45:
46: public TaskAdminTaglibException(Throwable t, String additionalMsg) {
47: super (additionalMsg);
48: wrapped = t;
49: }
50:
51: public Throwable getWrapped() {
52: return wrapped;
53: }
54:
55: public String toString() {
56: StringBuffer b = new StringBuffer();
57:
58: if (getWrapped() != null) {
59: b.append(wrapped.toString());
60: }
61: b.append(super .toString());
62:
63: return b.toString();
64: }
65:
66: public void printStackTrace() {
67: super .printStackTrace();
68: if (getWrapped() != null) {
69: wrapped.printStackTrace();
70: }
71: }
72:
73: public void printStackTrace(PrintStream s) {
74: super .printStackTrace(s);
75: if (getWrapped() != null) {
76: wrapped.printStackTrace(s);
77: }
78: }
79:
80: public void printStackTrace(PrintWriter s) {
81: super.printStackTrace(s);
82: if (getWrapped() != null) {
83: wrapped.printStackTrace(s);
84: }
85: }
86:
87: }
|