1 28 29 package com.caucho.amber; 30 31 import java.sql.SQLException ; 32 33 36 public class AmberException extends SQLException { 37 private Throwable _rootCause; 38 39 42 public AmberException() 43 { 44 } 45 46 49 public AmberException(String message) 50 { 51 super(message); 52 } 53 54 60 public AmberException(String message, Throwable e) 61 { 62 super(message); 63 64 _rootCause = e; 65 } 66 67 73 public AmberException(Throwable e) 74 { 75 super(e.toString()); 76 77 _rootCause = e; 78 } 79 80 public static AmberException create(Throwable e) 81 { 82 if (e instanceof AmberException) 83 return (AmberException) e; 84 else if (e instanceof AmberRuntimeException) 85 throw (AmberRuntimeException) e; 86 else 87 return new AmberException(e); 88 } 89 90 93 public Throwable getCause() 94 { 95 return _rootCause; 96 } 97 } 98 | Popular Tags |