1 package com.teamkonzept.lib; 2 3 import java.io.*; 4 5 10 public class TKException 11 extends Exception 12 implements ErrorCodes 13 { 14 private int errorCode; 15 private Throwable originalException; 16 17 18 private boolean isPublic; 19 20 private int severity; 21 22 23 private TKHashtable params = null; 24 25 private Object [] arguments = null; 27 28 32 public TKException (String description, 33 int _errorCode, 34 int _severity, 35 boolean _ispublic, 36 Throwable t) 37 { 38 this(description, _errorCode, _severity, _ispublic, null, t); 39 } 40 41 public TKException (String description, 42 int _errorCode, 43 int _severity, 44 boolean _ispublic, 45 Object [] arguments, 46 Throwable t) 47 { 48 super(description); 49 errorCode = _errorCode; 50 originalException = t; 51 severity = _severity; 52 isPublic = _ispublic; 53 this.arguments = arguments; 54 } 55 56 public void setParams(TKHashtable _hash) 57 { 58 params = _hash; 59 } 60 61 public Throwable getOriginalException() 62 { 63 return originalException; 64 } 65 66 public int getErrorCode() 67 { 68 return errorCode; 69 } 70 71 public boolean isPublic() 72 { 73 return isPublic; 74 } 75 76 public int getSeverity() 77 { 78 return severity; 79 } 80 81 public Object [] getArguments () 82 { 83 return arguments; 84 } 85 86 89 public String getFullStackTrace() 90 { 91 if (originalException == null) 92 return ""; 93 StringWriter strWriter = new StringWriter(); 94 PrintWriter pw = new PrintWriter(strWriter); 95 originalException.printStackTrace(pw); 96 pw.close(); 97 return strWriter.getBuffer().toString(); 98 } 99 } 100 | Popular Tags |