01: package com.jamonapi.utils;
02:
03: import java.io.*;
04:
05: public class AppBaseException extends java.lang.Exception {
06:
07: String errorIndicator = "";
08:
09: public AppBaseException() {
10:
11: super ();
12:
13: }
14:
15: public AppBaseException(String msg) {
16:
17: super (msg);
18:
19: }
20:
21: public AppBaseException(String msg, String errorIndicator) {
22:
23: this (msg);
24:
25: this .errorIndicator = errorIndicator;
26:
27: }
28:
29: public String getErrorIndicator() {
30:
31: return errorIndicator;
32:
33: }
34:
35: public static RuntimeException getRuntimeException(Exception e) {
36:
37: // NOTE THIS should eventually be replaced by the CommandIterator.iterate() function that throws
38:
39: // a runtimeexception instead of an Exception
40:
41: StringWriter sw = new StringWriter();
42:
43: e.printStackTrace(new PrintWriter(sw));
44:
45: return new RuntimeException(sw.toString());
46:
47: }
48:
49: }
|