1 22 package fr.dyade.aaa.admin.cmd; 23 24 import java.lang.reflect.InvocationTargetException ; 25 26 public class ExceptionCmd extends Exception { 27 28 private Throwable throwable; 29 30 public ExceptionCmd() { 31 super(); 32 } 33 34 public ExceptionCmd(Throwable throwable) { 35 super(throwable.toString()); 37 this.throwable = throwable; 38 } 39 40 public ExceptionCmd(String s) { 41 super(s); 42 } 43 44 public String toString() { 45 StringBuffer buf = new StringBuffer (); 46 buf.append(super.toString()); 47 if (throwable instanceof InvocationTargetException ) { 48 InvocationTargetException ite = 49 (InvocationTargetException )throwable; 50 buf.append(": " + 51 ite.getTargetException().toString()); 52 } 53 return buf.toString(); 54 } 55 } 56 | Popular Tags |