Package org.eclipse.hono.util
Class AmqpErrorException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.eclipse.hono.util.AmqpErrorException
-
- All Implemented Interfaces:
Serializable
public final class AmqpErrorException extends RuntimeException
An exception wrapping an AMQP 1.0 error.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AmqpErrorException(String error, String description)
Creates a new exception for an error and description.AmqpErrorException(org.apache.qpid.proton.amqp.Symbol error, String description)
Creates a new exception for an error and description.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.qpid.proton.amqp.transport.ErrorCondition
asErrorCondition()
Gets an AMQPErrorCondition
based on this exception's error and description.static AmqpErrorException
from(org.apache.qpid.proton.amqp.transport.DeliveryState deliveryState)
Creates an exception for an AMQP delivery state.org.apache.qpid.proton.amqp.Symbol
getError()
Gets the AMQP error conveyed in this exception.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
AmqpErrorException
public AmqpErrorException(org.apache.qpid.proton.amqp.Symbol error, String description)
Creates a new exception for an error and description.- Parameters:
error
- The AMQP error to convey in this exception.description
- A textual description of the context the error occurred in.- Throws:
NullPointerException
- if error isnull
.
-
AmqpErrorException
public AmqpErrorException(String error, String description)
Creates a new exception for an error and description.- Parameters:
error
- The AMQP error to convey in this exception.description
- A textual description of the context the error occurred in.- Throws:
NullPointerException
- if error isnull
.
-
-
Method Detail
-
from
public static AmqpErrorException from(org.apache.qpid.proton.amqp.transport.DeliveryState deliveryState)
Creates an exception for an AMQP delivery state.- Parameters:
deliveryState
- The delivery state.- Returns:
- The exception.
- Throws:
NullPointerException
- if delivery state isnull
.
-
getError
public org.apache.qpid.proton.amqp.Symbol getError()
Gets the AMQP error conveyed in this exception.- Returns:
- The error.
-
asErrorCondition
public org.apache.qpid.proton.amqp.transport.ErrorCondition asErrorCondition()
Gets an AMQPErrorCondition
based on this exception's error and description.- Returns:
- The condition.
-
-