1 20 package org.enhydra.barracuda.plankton.exceptions; 21 22 29 public class NestableException extends Exception { 30 31 private Exception baseException = null; 32 33 36 public NestableException () { 37 this("Unidentified Exception"); 38 } 39 40 45 public NestableException (String s) { 46 this(s, null); 47 } 48 49 55 public NestableException (String s, Exception ibaseException) { 56 super(s); 57 baseException = ibaseException; 58 } 59 60 65 public Exception getBaseException () { 66 return baseException; 67 } 68 69 79 public synchronized static Exception getRootException (NestableException ne) { 80 Exception e = ne.getBaseException(); 81 if (e!=null && e instanceof NestableException) return getRootException ((NestableException) e); 82 return ne; 83 } 84 } | Popular Tags |