StorageException Class

  • java.lang.Object
    • Exception
      • com.microsoft.azure.storage.StorageException

public class StorageException

Represents an exception for the Microsoft Azure storage service.

Field Summary

Modifier and Type Field and Description
String errorCode

Represents the error code returned by the operation.

StorageExtendedErrorInformation extendedErrorInformation

Represents the extended error information returned by the operation.

Constructor Summary

Constructor Description
StorageException(final String errorCode, final String message, final Exception innerException)

Creates an instance of the class using the specified parameters. The status code will be 306 to represent a client side exception with null for the extended error information.

StorageException(final String errorCode, final String message, final int statusCode, final StorageExtendedErrorInformation extendedErrorInfo, final Exception innerException)

Creates an instance of the class using the specified parameters.

Method Summary

Modifier and Type Method and Description
String getErrorCode()

Gets the error code returned by the operation.

StorageExtendedErrorInformation getExtendedErrorInformation()

Gets the extended error information returned by the operation.

int getHttpStatusCode()

Gets the HTTP status code returned by the operation.

StorageException translateClientException(final Exception cause)

RESERVED FOR INTERNAL USE. Translates the specified exception into a storage exception.

StorageException translateException(final StorageRequest<?, ?, ?> request, final Exception cause, final OperationContext opContext)

RESERVED FOR INTERNAL USE. Translates the specified exception into a storage exception.

Field Details

errorCode

protected String errorCode

Represents the error code returned by the operation.

extendedErrorInformation

protected StorageExtendedErrorInformation extendedErrorInformation

Represents the extended error information returned by the operation.

Constructor Details

StorageException

public StorageException(final String errorCode, final String message, final Exception innerException)

Creates an instance of the class using the specified parameters. The status code will be 306 to represent a client side exception with null for the extended error information.

Parameters:

errorCode - A String that represents the error code returned by the operation.
message - A String that represents the error message returned by the operation.
innerException - An Exception object that represents a reference to the initial exception, if one exists.

StorageException

public StorageException(final String errorCode, final String message, final int statusCode, final StorageExtendedErrorInformation extendedErrorInfo, final Exception innerException)

Creates an instance of the class using the specified parameters.

Parameters:

errorCode - A String that represents the error code returned by the operation.
message - A String that represents the error message returned by the operation.
statusCode - The HTTP status code returned by the operation.
extendedErrorInfo - A StorageExtendedErrorInformation object that represents the extended error information returned by the operation.
innerException - An Exception object that represents a reference to the initial exception, if one exists.

Method Details

getErrorCode

public String getErrorCode()

Gets the error code returned by the operation.

Returns:

the errorCode

getExtendedErrorInformation

public StorageExtendedErrorInformation getExtendedErrorInformation()

Gets the extended error information returned by the operation.

Returns:

the extendedErrorInformation

getHttpStatusCode

public int getHttpStatusCode()

Gets the HTTP status code returned by the operation.

Returns:

the httpStatusCode

translateClientException

public static StorageException translateClientException(final Exception cause)

RESERVED FOR INTERNAL USE. Translates the specified exception into a storage exception.

Parameters:

cause - An Exception object that represents the exception to translate.

Returns:

A StorageException object that represents translated exception.

translateException

public static StorageException translateException(final StorageRequest request, final Exception cause, final OperationContext opContext)

RESERVED FOR INTERNAL USE. Translates the specified exception into a storage exception.

Parameters:

request - An HttpURLConnection object that represents the request whose exception is being translated.
cause - An Exception object that represents the exception to translate.
opContext

Returns:

A StorageException object that represents translated exception.

Applies to