1 17 package org.apache.excalibur.xml.xpath; 18 19 import java.io.PrintStream ; 20 import java.io.PrintWriter ; 21 22 import org.apache.avalon.framework.CascadingException; 23 24 27 public class XPathException extends CascadingException { 28 29 32 public XPathException(String message) { 33 super(message, null); 34 } 35 36 41 public XPathException(Exception ex) { 42 super(ex.getMessage(), ex); 43 } 44 45 49 public XPathException(String message, Throwable t) { 50 super(message, t); 51 } 52 53 public String toString() { 54 StringBuffer s = new StringBuffer (); 55 s.append(super.toString()); 56 final Throwable t = getCause(); 57 if(t!=null) { 58 s.append(": "); 59 s.append(t.toString()); 60 } 61 return s.toString(); 62 } 63 64 public void printStackTrace() { 65 super.printStackTrace(); 66 if(getCause()!=null) 67 getCause().printStackTrace(); 68 } 69 70 public void printStackTrace( PrintStream s ) { 71 super.printStackTrace(s); 72 if(getCause()!=null) 73 getCause().printStackTrace(s); 74 } 75 76 public void printStackTrace( PrintWriter s ) { 77 super.printStackTrace(s); 78 if(getCause()!=null) 79 getCause().printStackTrace(s); 80 } 81 } 82 | Popular Tags |