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