Package org.jivesoftware.smack
Class XMPPException.XMPPErrorException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.jivesoftware.smack.XMPPException
org.jivesoftware.smack.XMPPException.XMPPErrorException
- All Implemented Interfaces:
Serializable
- Enclosing class:
XMPPException
An exception caused by an XMPP error stanza response on the protocol level. You can examine the underlying
StanzaError by calling getStanzaError().- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jivesoftware.smack.XMPPException
XMPPException.FailedNonzaException, XMPPException.StreamErrorException, XMPPException.XMPPErrorException -
Constructor Summary
ConstructorsConstructorDescriptionXMPPErrorException(Stanza stanza, StanzaError error) Creates a new XMPPErrorException with the XMPPError that was the root case of the exception.XMPPErrorException(Stanza stanza, StanzaError error, Stanza request) Creates a new XMPPErrorException with the XMPPError that was the root case of the exception. -
Method Summary
Modifier and TypeMethodDescriptionGet the request which triggered the error response causing this exception.Gets the stanza associated with this exception.Returns the stanza error extension element associated with this exception.static voidifHasErrorThenThrow(Stanza packet) static voidifHasErrorThenThrow(Stanza packet, Stanza request) Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
XMPPErrorException
Creates a new XMPPErrorException with the XMPPError that was the root case of the exception.- Parameters:
stanza- stanza that contained the exception.error- the root cause of the exception.
-
XMPPErrorException
Creates a new XMPPErrorException with the XMPPError that was the root case of the exception.- Parameters:
stanza- stanza that contained the exception.error- the root cause of the exception.request- the request which triggered the error.- Since:
- 4.3.0
-
-
Method Details
-
getStanzaError
Returns the stanza error extension element associated with this exception.- Returns:
- the stanza error extension element associated with this exception.
-
getStanza
Gets the stanza associated with this exception.- Returns:
- the stanza from which this exception was created or
nullif the exception is not from a stanza.
-
getRequest
Get the request which triggered the error response causing this exception.- Returns:
- the request or
null. - Since:
- 4.3.0
-
getMessage
- Overrides:
getMessagein classThrowable
-
ifHasErrorThenThrow
- Throws:
XMPPException.XMPPErrorException
-
ifHasErrorThenThrow
public static void ifHasErrorThenThrow(Stanza packet, Stanza request) throws XMPPException.XMPPErrorException - Throws:
XMPPException.XMPPErrorException
-