diff --git a/smack-core/src/main/java/org/jivesoftware/smack/XMPPException.java b/smack-core/src/main/java/org/jivesoftware/smack/XMPPException.java index ce4c0a4f0..f7235fb48 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/XMPPException.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/XMPPException.java @@ -120,6 +120,16 @@ public abstract class XMPPException extends Exception { return error; } + /** + * Gets the stanza associated with this exception. + * + * @return the stanza from which this exception was created or {@code null} if the exception is not from a + * stanza. + */ + public Stanza getStanza() { + return stanza; + } + /** * Get the request which triggered the error response causing this exception. *