SalimAzureBlobAPI/SalimAzureAPI/AzureBlobManager.cs
/// <summary>
/// Tries to perform the specified Action. An exception is thrown that is not a "409" exception.
/// Blob service error codes: https://msdn.microsoft.com/en-au/library/azure/dd179439.aspx
/// </summary>
/// <param name="action">The Action to perform.</param>
/// <returns>True if no exceptions or only a 409 error; false otherwise.</returns>
Tries to perform the specified Action. An exception is thrown that is not a "409" exception.
Tries to perform the specified Action . An exception is thrown that is not a " 409 " exception .
private bool ExecuteWithExceptionHandlingAndReturnValue(Action action)
        {
            try
            {
                action();
                return true;
            }
            catch (StorageException ex)
            {
                if (ex.RequestInformation.ExtendedErrorInformation.ErrorCode != "409")
                {
                    return false;
                }
                throw;
            }
        }
private bool ExecuteWithExceptionHandlingAndReturnValue ( Action action ) { try { action ( ) ; return true ; } catch ( StorageException ex ) { if ( ex . RequestInformation . ExtendedErrorInformation . ErrorCode != " " ) { return false ; } throw ; } }
Tries to perform the specified Action.
Tries to perform the specified Action .
//Blob service error codes: https://msdn.microsoft.com/en-au/library/azure/dd179439.aspx //Ignore lease already present error
True if no exceptions or only a 409 error; false otherwise.
True if no exceptions or only a 409 error ; false otherwise .
action
Action
The Action to perform.
The Action to perform .