Package com.azure.storage.queue.models
Class QueueStorageException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.azure.core.exception.AzureException
com.azure.core.exception.HttpResponseException
com.azure.storage.queue.models.QueueStorageException
- All Implemented Interfaces:
Serializable
public final class QueueStorageException
extends com.azure.core.exception.HttpResponseException
A
StorageException
is thrown whenever Azure Storage successfully returns an error code that is not 200-level.
Users can inspect the status code and error code to determine the cause of the error response. The exception message
may also contain more detailed information depending on the type of error. The user may also inspect the raw HTTP
response or call toString to get the full payload of the error response if present.
Note that even some expected "errors" will be thrown as a StorageException
. For example, some users may
perform a getProperties request on an entity to determine whether it exists or not. If it does not exists, an
exception will be thrown even though this may be considered an expected indication of absence in this case.
Sample Code
For more samples, please see the sample file
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionQueueStorageException
(String message, com.azure.core.http.HttpResponse response, Object value) Constructs aStorageException
. -
Method Summary
Modifier and TypeMethodDescriptionGets the error code returned by the service.Gets the message returned by the service.int
Gets the status code on the response.Methods inherited from class com.azure.core.exception.HttpResponseException
getResponse, getValue
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
QueueStorageException
public QueueStorageException(String message, com.azure.core.http.HttpResponse response, Object value) Constructs aStorageException
.- Parameters:
message
- the exception message or the response content if a message is not available.response
- the HTTP response.value
- the error code of the exception.
-
-
Method Details
-
getErrorCode
Gets the error code returned by the service.- Returns:
- The error code returned by the service.
-
getServiceMessage
Gets the message returned by the service.- Returns:
- The message returned by the service.
-
getStatusCode
public int getStatusCode()Gets the status code on the response.- Returns:
- The status code on the response.
-