StorageExceptionExtensions
Provide helpful information about errors calling Azure Storage endpoints.
namespace Azure.Storage
{
internal static class StorageExceptionExtensions
{
public static string GetErrorCode(this Response response, string errorCode)
{
if (string.IsNullOrEmpty(errorCode))
response.Headers.TryGetValue("x-ms-error-code", out errorCode);
return errorCode;
}
public static bool <>(this Response<T> response)
{
return (((NullableResponse<T>)response)?.GetRawResponse().Status ?? 0) == 304;
}
public static Response<T> AsNoBodyResponse<T>(this Response rawResponse)
{
return new NoBodyResponse<T>(rawResponse);
}
}
}