mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 20:12:07 +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 {
|
public class XMPPException extends Exception {
|
||||||
|
|
||||||
private Throwable cause;
|
private Error error = null;
|
||||||
|
private Throwable cause = null;
|
||||||
|
|
||||||
public XMPPException() {
|
public XMPPException() {
|
||||||
super();
|
super();
|
||||||
|
@ -78,26 +79,51 @@ public class XMPPException extends Exception {
|
||||||
this.cause = cause;
|
this.cause = cause;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public XMPPException(Error error) {
|
||||||
|
super();
|
||||||
|
this.error = error;
|
||||||
|
}
|
||||||
|
|
||||||
public XMPPException(String message, Throwable cause) {
|
public XMPPException(String message, Throwable cause) {
|
||||||
super(message);
|
super(message);
|
||||||
this.cause = cause;
|
this.cause = cause;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public XMPPException(String message, Error error) {
|
||||||
|
super(message);
|
||||||
|
this.error = error;
|
||||||
|
}
|
||||||
|
|
||||||
public void printStackTrace() {
|
public void printStackTrace() {
|
||||||
|
if (error != null) {
|
||||||
|
System.err.println(error);
|
||||||
|
}
|
||||||
super.printStackTrace();
|
super.printStackTrace();
|
||||||
System.err.println("Nested Exception: ");
|
if (cause != null) {
|
||||||
cause.printStackTrace();
|
System.err.println("Nested Exception: ");
|
||||||
|
cause.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void printStackTrace(PrintStream out) {
|
public void printStackTrace(PrintStream out) {
|
||||||
|
if (error != null) {
|
||||||
|
System.err.println(error);
|
||||||
|
}
|
||||||
super.printStackTrace(out);
|
super.printStackTrace(out);
|
||||||
out.println("Nested Exception: ");
|
if (cause != null) {
|
||||||
cause.printStackTrace(out);
|
out.println("Nested Exception: ");
|
||||||
|
cause.printStackTrace(out);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void printStackTrace(PrintWriter out) {
|
public void printStackTrace(PrintWriter out) {
|
||||||
|
if (error != null) {
|
||||||
|
System.err.println(error);
|
||||||
|
}
|
||||||
super.printStackTrace(out);
|
super.printStackTrace(out);
|
||||||
out.println("Nested Exception: ");
|
if (cause != null) {
|
||||||
cause.printStackTrace(out);
|
out.println("Nested Exception: ");
|
||||||
|
cause.printStackTrace(out);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue