1 28 29 package com.caucho.es; 30 31 import com.caucho.util.ExceptionWrapper; 32 33 import java.io.PrintStream ; 34 import java.io.PrintWriter ; 35 36 39 public class ESWrapperException extends ESException 40 implements ExceptionWrapper { 41 private Throwable e; 42 43 public ESWrapperException(Throwable e) 44 { 45 if (e == null) 46 throw new NullPointerException (); 47 48 this.e = e; 49 } 50 51 public static ESException create(Throwable e) 52 { 53 if (e instanceof ESException) 54 return (ESException) e; 55 else 56 return new ESWrapperException(e); 57 } 58 59 public void printStackTrace() 60 { 61 e.printStackTrace(); 62 } 63 64 public void printStackTrace(PrintStream ps) 65 { 66 e.printStackTrace(ps); 67 } 68 69 public void printStackTrace(PrintWriter pw) 70 { 71 e.printStackTrace(pw); 72 } 73 74 77 public Throwable getRootCause() 78 { 79 return e; 80 } 81 82 public String getMessage() { return e.getMessage(); } 83 84 public String toString() { return e.toString(); } 85 public Throwable getException() { return e; } 86 } 87 88 89 90 | Popular Tags |