diff --git a/readme.md b/readme.md index 142dc0e..d537986 100644 --- a/readme.md +++ b/readme.md @@ -7,7 +7,7 @@ |Build/Package|Status| |------|-------------| |master|[![Build status](https://ci.appveyor.com/api/projects/status/e4lwcdjf51e56i87/branch/master?svg=true)](https://ci.appveyor.com/project/serkantkaraca/azure-event-hubs-dotnet/branch/master) [![codecov](https://codecov.io/gh/Azure/azure-event-hubs-dotnet/branch/master/graph/badge.svg)](https://codecov.io/gh/Azure/azure-event-hubs-dotnet)| -|dev|[![Build status](https://ci.appveyor.com/api/projects/status/e4lwcdjf51e56i87/branch/master?svg=true)](https://ci.appveyor.com/project/serkantkaraca/azure-event-hubs-dotnet/branch/dev) [![codecov](https://codecov.io/gh/Azure/azure-event-hubs-dotnet/branch/dev/graph/badge.svg)](https://codecov.io/gh/Azure/azure-event-hubs-dotnet)| +|dev|[![Build status](https://ci.appveyor.com/api/projects/status/e4lwcdjf51e56i87/branch/dev?svg=true)](https://ci.appveyor.com/project/serkantkaraca/azure-event-hubs-dotnet/branch/dev) [![codecov](https://codecov.io/gh/Azure/azure-event-hubs-dotnet/branch/dev/graph/badge.svg)](https://codecov.io/gh/Azure/azure-event-hubs-dotnet)| |Microsoft.Azure.EventHubs|[![NuGet Version and Downloads count](https://buildstats.info/nuget/Microsoft.Azure.EventHubs?includePreReleases=true)](https://www.nuget.org/packages/Microsoft.Azure.EventHubs/)| |Microsoft.Azure.EventHubs.Processor|[![NuGet Version and Downloads count](https://buildstats.info/nuget/Microsoft.Azure.EventHubs.Processor?includePreReleases=true)](https://www.nuget.org/packages/Microsoft.Azure.EventHubs.Processor/)| diff --git a/src/Microsoft.Azure.EventHubs.Processor/AzureStorageCheckpointLeaseManager.cs b/src/Microsoft.Azure.EventHubs.Processor/AzureStorageCheckpointLeaseManager.cs index 55ebd14..045b14c 100644 --- a/src/Microsoft.Azure.EventHubs.Processor/AzureStorageCheckpointLeaseManager.cs +++ b/src/Microsoft.Azure.EventHubs.Processor/AzureStorageCheckpointLeaseManager.cs @@ -268,10 +268,8 @@ public async Task CreateLeaseIfNotExistsAsync(string partitionId) // thro } catch (StorageException se) { - StorageExtendedErrorInformation extendedErrorInfo = se.RequestInformation.ExtendedErrorInformation; - if (extendedErrorInfo != null && - (extendedErrorInfo.ErrorCode == BlobErrorCodeStrings.BlobAlreadyExists || - extendedErrorInfo.ErrorCode == BlobErrorCodeStrings.LeaseIdMissing)) // occurs when somebody else already has leased the blob + if (se.RequestInformation.ErrorCode == BlobErrorCodeStrings.BlobAlreadyExists || + se.RequestInformation.ErrorCode == BlobErrorCodeStrings.LeaseIdMissing) // occurs when somebody else already has leased the blob { // The blob already exists. ProcessorEventSource.Log.AzureStorageManagerInfo(this.host.Id, partitionId, "Lease already exists"); @@ -458,19 +456,15 @@ Exception HandleStorageException(string partitionId, StorageException se) if (se.RequestInformation.HttpStatusCode == 409 || // conflict se.RequestInformation.HttpStatusCode == 412) // precondition failed { - StorageExtendedErrorInformation extendedErrorInfo = se.RequestInformation.ExtendedErrorInformation; - - if (extendedErrorInfo != null) - { - string errorCode = extendedErrorInfo.ErrorCode; - ProcessorEventSource.Log.AzureStorageManagerInfo(this.host.Id, partitionId, "HandleStorageException - Error code: " + errorCode); - ProcessorEventSource.Log.AzureStorageManagerInfo(this.host.Id, partitionId, "HandleStorageException - Error message: " + extendedErrorInfo.ErrorMessage); - } - - if (extendedErrorInfo == null || - extendedErrorInfo.ErrorCode == BlobErrorCodeStrings.LeaseLost || - extendedErrorInfo.ErrorCode == BlobErrorCodeStrings.LeaseIdMismatchWithLeaseOperation || - extendedErrorInfo.ErrorCode == BlobErrorCodeStrings.LeaseIdMismatchWithBlobOperation) + ProcessorEventSource.Log.AzureStorageManagerInfo(this.host.Id, partitionId, + "HandleStorageException - Error code: " + se.RequestInformation.ErrorCode); + ProcessorEventSource.Log.AzureStorageManagerInfo(this.host.Id, partitionId, + "HandleStorageException - Error message: " + se.RequestInformation.ExtendedErrorInformation?.ErrorMessage); + + if (se.RequestInformation.ErrorCode == null || + se.RequestInformation.ErrorCode == BlobErrorCodeStrings.LeaseLost || + se.RequestInformation.ErrorCode == BlobErrorCodeStrings.LeaseIdMismatchWithLeaseOperation || + se.RequestInformation.ErrorCode == BlobErrorCodeStrings.LeaseIdMismatchWithBlobOperation) { return new LeaseLostException(partitionId, se); } diff --git a/src/Microsoft.Azure.EventHubs.Processor/Microsoft.Azure.EventHubs.Processor.csproj b/src/Microsoft.Azure.EventHubs.Processor/Microsoft.Azure.EventHubs.Processor.csproj index 07cc13a..605b42e 100644 --- a/src/Microsoft.Azure.EventHubs.Processor/Microsoft.Azure.EventHubs.Processor.csproj +++ b/src/Microsoft.Azure.EventHubs.Processor/Microsoft.Azure.EventHubs.Processor.csproj @@ -42,8 +42,8 @@ - - + + diff --git a/src/Microsoft.Azure.EventHubs/Microsoft.Azure.EventHubs.csproj b/src/Microsoft.Azure.EventHubs/Microsoft.Azure.EventHubs.csproj index 92709c8..d54f33b 100644 --- a/src/Microsoft.Azure.EventHubs/Microsoft.Azure.EventHubs.csproj +++ b/src/Microsoft.Azure.EventHubs/Microsoft.Azure.EventHubs.csproj @@ -62,12 +62,13 @@ - + - - - + + + +