1 7 8 package javax.security.sasl; 9 10 import java.io.IOException ; 11 12 20 21 public class SaslException extends IOException { 22 26 private Throwable _exception; 28 29 33 public SaslException () { 34 super(); 35 } 36 37 44 public SaslException (String detail) { 45 super(detail); 46 } 47 48 64 public SaslException (String detail, Throwable ex) { 65 super(detail); 66 if (ex != null) { 67 initCause(ex); 68 } 69 } 70 71 75 public Throwable getCause() { 76 return _exception; 77 } 78 79 83 public Throwable initCause(Throwable cause) { 84 super.initCause(cause); 85 _exception = cause; 86 return this; 87 } 88 89 100 public String toString() { 102 String answer = super.toString(); 103 if (_exception != null && _exception != this) { 104 answer += " [Caused by " + _exception.toString() + "]"; 105 } 106 return answer; 107 } 108 109 110 private static final long serialVersionUID = 4579784287983423626L; 111 } 112 | Popular Tags |