StorageException Class

Storage Client Library NET API

[This topic is part of the Microsoft Azure Storage Client Library 1.7, which has been deprecated. See Storage Client Library for the latest version.]

The base class for Windows Azure storage service exceptions.

Namespace: Microsoft.WindowsAzure.StorageClient
Assembly: Microsoft.WindowsAzure.StorageClient (in Microsoft.WindowsAzure.StorageClient.dll)

Usage

Visual Basic
Dim instance As StorageException

Syntax

Visual Basic
<SerializableAttribute> _
Public MustInherit Class StorageException
	Inherits Exception
C#
[SerializableAttribute] 
public abstract class StorageException : Exception
C++
[SerializableAttribute] 
public ref class StorageException abstract : public Exception
J#
JScript

Remarks

Based on the source of the error that caused the exception to be thrown, Windows Azure storage services may throw a StorageClientException or a StorageServerException. The StorageException will never be thrown directly. However, it can be difficult or impossible to predict which of the derived exception types will be thrown for an arbitrary piece of code. Regardless, the StorageException base class usually contains sufficient detail regarding the error for you to determine how your application should proceed. Additional guidance regarding how to handle the different exception types can be found in the documentation for the derived classes, StorageClientException or StorageServerException.

C# Copy Code
try 
{
    // Storage access code
}
catch (Microsoft.WindowsAzure.StorageClient.StorageException ex)
{
    // Inspect ex.ErrorCode or ex.StatusCode for error information
}
catch (System.Exception ex)
{
    // General exception handler
}

When the StorageException is also a StorageClientException exception, additional error details can be found in the ExtendedErrorInformation property. Otherwise, this property is null.


Inheritance Hierarchy

System.Object
   System.Exception
    Microsoft.WindowsAzure.StorageClient.StorageException
       Microsoft.WindowsAzure.StorageClient.StorageClientException
       Microsoft.WindowsAzure.StorageClient.StorageServerException

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Vista, Windows 7, Windows Server 2008, Windows 8.1, Windows Server 2012 R2, Windows 8 and Windows Server 2012

Change History

See Also