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
public static class XMPPException.XMPPErrorException extends XMPPException
An exception caused by an XMPP error stanza response on the protocol level. You can examine the underlyingStanzaError
by callinggetStanzaError()
.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jivesoftware.smack.XMPPException
XMPPException.FailedNonzaException, XMPPException.StreamErrorException, XMPPException.XMPPErrorException
-
-
Constructor Summary
Constructors Constructor Description XMPPErrorException(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getMessage()
Stanza
getRequest()
Get the request which triggered the error response causing this exception.Stanza
getStanza()
Gets the stanza associated with this exception.StanzaError
getStanzaError()
Returns the stanza error extension element associated with this exception.static void
ifHasErrorThenThrow(Stanza packet)
static void
ifHasErrorThenThrow(Stanza packet, Stanza request)
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
XMPPErrorException
public XMPPErrorException(Stanza stanza, StanzaError error)
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
public XMPPErrorException(Stanza stanza, StanzaError error, Stanza request)
Creates a new XMPPErrorException with the XMPPError that was the root case of the exception.- Parameters:
request
- the request which triggered the error.stanza
- stanza that contained the exception.error
- the root cause of the exception.- Since:
- 4.3.0
-
-
Method Detail
-
getStanzaError
public StanzaError getStanzaError()
Returns the stanza error extension element associated with this exception.- Returns:
- the stanza error extension element associated with this exception.
-
getStanza
public Stanza getStanza()
Gets the stanza associated with this exception.- Returns:
- the stanza from which this exception was created or
null
if the exception is not from a stanza.
-
getRequest
public Stanza getRequest()
Get the request which triggered the error response causing this exception.- Returns:
- the request or
null
. - Since:
- 4.3.0
-
getMessage
public String getMessage()
- Overrides:
getMessage
in classThrowable
-
ifHasErrorThenThrow
public static void ifHasErrorThenThrow(Stanza packet) throws XMPPException.XMPPErrorException
- Throws:
XMPPException.XMPPErrorException
-
ifHasErrorThenThrow
public static void ifHasErrorThenThrow(Stanza packet, Stanza request) throws XMPPException.XMPPErrorException
- Throws:
XMPPException.XMPPErrorException
-
-