Package com.azure.core.amqp.exception
Class AmqpException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.azure.core.exception.AzureException
-
- com.azure.core.amqp.exception.AmqpException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
OperationCancelledException
public class AmqpException extends AzureException
General exception for AMQP related failures.
-
-
Constructor Summary
Constructors Constructor Description AmqpException(boolean isTransient, AmqpErrorCondition errorCondition, String message, AmqpErrorContext errorContext)
Initializes a new instance of the AmqpException class.AmqpException(boolean isTransient, AmqpErrorCondition errorCondition, String message, Throwable cause, AmqpErrorContext errorContext)
Initializes a new instance of the AmqpException class.AmqpException(boolean isTransient, AmqpErrorCondition errorCondition, Throwable cause, AmqpErrorContext errorContext)
Initializes a new instance of the AmqpException class.AmqpException(boolean isTransient, String message, AmqpErrorContext errorContext)
Initializes a new instance of the AmqpException class.AmqpException(boolean isTransient, String message, Throwable cause, AmqpErrorContext errorContext)
Initializes a new instance of the AmqpException class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AmqpErrorContext
getContext()
Gets the context for this exception.AmqpErrorCondition
getErrorCondition()
Gets theAmqpErrorCondition
for this exception.String
getMessage()
boolean
isTransient()
A boolean indicating if the exception is a transient error or not.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
AmqpException
public AmqpException(boolean isTransient, String message, AmqpErrorContext errorContext)
Initializes a new instance of the AmqpException class.- Parameters:
isTransient
- A boolean indicating if the exception is a transient error or not. If true, then the request can be retried; otherwise not.message
- Text containing any supplementary details of the exception.errorContext
- The context that caused this AMQP error.
-
AmqpException
public AmqpException(boolean isTransient, AmqpErrorCondition errorCondition, String message, AmqpErrorContext errorContext)
Initializes a new instance of the AmqpException class.- Parameters:
isTransient
- A boolean indicating if the exception is a transient error or not. If true, then the request can be retried; otherwise not.errorCondition
- The symbolic value indicating the error condition.message
- Text containing any supplementary details not indicated by the condition field. This text can be logged as an aid to resolving issues.errorContext
- The context that caused this AMQP error.
-
AmqpException
public AmqpException(boolean isTransient, AmqpErrorCondition errorCondition, String message, Throwable cause, AmqpErrorContext errorContext)
Initializes a new instance of the AmqpException class.- Parameters:
isTransient
- A boolean indicating if the exception is a transient error or not. If true, then the request can be retried; otherwise not.errorCondition
- The symbolic value indicating the error condition.message
- Text containing any supplementary details not indicated by the condition field. This text can be logged as an aid to resolving issues.cause
- The Throwable which caused the creation of this AmqpException.errorContext
- The context that caused this AMQP error.
-
AmqpException
public AmqpException(boolean isTransient, AmqpErrorCondition errorCondition, Throwable cause, AmqpErrorContext errorContext)
Initializes a new instance of the AmqpException class.- Parameters:
isTransient
- A boolean indicating if the exception is a transient error or not. If true, then the request can be retried; otherwise not.errorCondition
- The symbolic value indicating the error condition.cause
- The Throwable which caused the creation of this AmqpException.errorContext
- The context that caused this AMQP error.
-
AmqpException
public AmqpException(boolean isTransient, String message, Throwable cause, AmqpErrorContext errorContext)
Initializes a new instance of the AmqpException class.- Parameters:
isTransient
- A boolean indicating if the exception is a transient error or not. If true, then the request can be retried; otherwise not.message
- Text containing any supplementary details not indicated by the condition field. This text can be logged as an aid to resolving issues.cause
- The Throwable which caused the creation of this AmqpException.errorContext
- The context that caused this AMQP error.
-
-
Method Detail
-
getMessage
public String getMessage()
- Overrides:
getMessage
in classThrowable
-
isTransient
public boolean isTransient()
A boolean indicating if the exception is a transient error or not.- Returns:
- returns true when user can retry the operation that generated the exception without additional intervention.
-
getErrorCondition
public AmqpErrorCondition getErrorCondition()
Gets theAmqpErrorCondition
for this exception.- Returns:
- The
AmqpErrorCondition
for this exception, ornull
if nothing was set.
-
getContext
public AmqpErrorContext getContext()
Gets the context for this exception.- Returns:
- The context for this exception.
-
-