mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 14:22:05 +01:00
Support for XMPPError class.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@1842 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
3d5c656e1f
commit
867e1714ad
1 changed files with 33 additions and 7 deletions
|
@ -63,7 +63,8 @@ import java.io.PrintWriter;
|
|||
*/
|
||||
public class XMPPException extends Exception {
|
||||
|
||||
private Throwable cause;
|
||||
private Error error = null;
|
||||
private Throwable cause = null;
|
||||
|
||||
public XMPPException() {
|
||||
super();
|
||||
|
@ -78,26 +79,51 @@ public class XMPPException extends Exception {
|
|||
this.cause = cause;
|
||||
}
|
||||
|
||||
public XMPPException(Error error) {
|
||||
super();
|
||||
this.error = error;
|
||||
}
|
||||
|
||||
public XMPPException(String message, Throwable cause) {
|
||||
super(message);
|
||||
this.cause = cause;
|
||||
}
|
||||
|
||||
public XMPPException(String message, Error error) {
|
||||
super(message);
|
||||
this.error = error;
|
||||
}
|
||||
|
||||
public void printStackTrace() {
|
||||
if (error != null) {
|
||||
System.err.println(error);
|
||||
}
|
||||
super.printStackTrace();
|
||||
System.err.println("Nested Exception: ");
|
||||
cause.printStackTrace();
|
||||
if (cause != null) {
|
||||
System.err.println("Nested Exception: ");
|
||||
cause.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void printStackTrace(PrintStream out) {
|
||||
if (error != null) {
|
||||
System.err.println(error);
|
||||
}
|
||||
super.printStackTrace(out);
|
||||
out.println("Nested Exception: ");
|
||||
cause.printStackTrace(out);
|
||||
if (cause != null) {
|
||||
out.println("Nested Exception: ");
|
||||
cause.printStackTrace(out);
|
||||
}
|
||||
}
|
||||
|
||||
public void printStackTrace(PrintWriter out) {
|
||||
if (error != null) {
|
||||
System.err.println(error);
|
||||
}
|
||||
super.printStackTrace(out);
|
||||
out.println("Nested Exception: ");
|
||||
cause.printStackTrace(out);
|
||||
if (cause != null) {
|
||||
out.println("Nested Exception: ");
|
||||
cause.printStackTrace(out);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue