package de.thedevstack.conversationsplus.xmpp.exceptions; import de.thedevstack.conversationsplus.xml.Element; /** * */ public class XmppException extends Exception { private Element context; /** * Constructs a new {@code Exception} that includes the current stack trace. */ public XmppException() { } /** * Constructs a new {@code Exception} that includes the current stack trace. */ public XmppException(Element context) { this.context = context; } /** * Constructs a new {@code Exception} with the current stack trace and the * specified cause. * * @param throwable the cause of this exception. */ public XmppException(Throwable throwable) { super(throwable); } /** * Constructs a new {@code Exception} with the current stack trace and the * specified cause. * * @param throwable the cause of this exception. */ public XmppException(Element context, Throwable throwable) { super(throwable); this.context = context; } @Override public String getMessage() { if (null != context) { return "Error in XMPP Element. XML element is: " + this.context.toString(); } else { return super.getMessage(); } } public Element getContext() { return context; } }