public class StorageException extends Exception
| Modifier and Type | Field and Description |
|---|---|
protected String |
errorCode
Represents the error code returned by the operation.
|
protected StorageExtendedErrorInformation |
extendedErrorInformation
Represents the extended error information returned by the operation.
|
| Constructor and Description |
|---|
StorageException(String errorCode,
String message,
int statusCode,
StorageExtendedErrorInformation extendedErrorInfo,
Exception innerException)
Creates an instance of the
StorageException class using the specified parameters. |
| Modifier and Type | Method and Description |
|---|---|
String |
getErrorCode() |
protected static StorageExtendedErrorInformation |
getErrorDetailsFromRequest(HttpURLConnection request,
OperationContext opContext)
Returns extended error information from the specified request and operation context.
|
StorageExtendedErrorInformation |
getExtendedErrorInformation() |
int |
getHttpStatusCode() |
static StorageException |
translateException(HttpURLConnection request,
Exception cause,
OperationContext opContext)
Translates the specified exception into a storage exception.
|
protected static StorageException |
translateFromHttpStatus(int statusCode,
String statusDescription,
StorageExtendedErrorInformation details,
Exception inner)
Translates the specified HTTP status code into a storage exception.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringprotected String errorCode
protected StorageExtendedErrorInformation extendedErrorInformation
StorageExtendedErrorInformationpublic StorageException(String errorCode, String message, int statusCode, StorageExtendedErrorInformation extendedErrorInfo, Exception innerException)
StorageException class using the specified 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.StorageExtendedErrorInformationprotected static StorageExtendedErrorInformation getErrorDetailsFromRequest(HttpURLConnection request, OperationContext opContext)
request - An HttpURLConnection object that represents the request whose extended error information
is being retrieved.opContext - An OperationContext object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.StorageExtendedErrorInformation object that represents the error details for the specified
request.public static StorageException translateException(HttpURLConnection request, Exception cause, OperationContext opContext)
request - An HttpURLConnection object that represents the request whose exception is being
translated.cause - An Exception object that represents the exception to translate.opContext - An OperationContext object that represents the context for the current operation. This object
is used to track requests to the storage service, and to provide additional runtime information about
the operation.StorageException object that represents translated exception.protected static StorageException translateFromHttpStatus(int statusCode, String statusDescription, StorageExtendedErrorInformation details, Exception inner)
statusCode - The HTTP status code returned by the operation.statusDescription - A String that represents the status description.details - A StorageExtendedErrorInformation object that represents the errror details returned by the
operation.inner - An Exception object that represents a reference to the initial exception, if one exists.StorageException object that represents translated exception.public String getErrorCode()
public StorageExtendedErrorInformation getExtendedErrorInformation()
public int getHttpStatusCode()
/**
* Copyright Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/