| | | 1 | | // Copyright (c) Microsoft. All rights reserved. |
| | | 2 | | // Licensed under the MIT license. See LICENSE file in the project root for full license information. |
| | | 3 | | |
| | | 4 | | using Microsoft.Azure.EventHubs.Primitives; |
| | | 5 | | |
| | | 6 | | namespace Microsoft.Azure.EventHubs.Processor |
| | | 7 | | { |
| | | 8 | | using System; |
| | | 9 | | |
| | | 10 | | /// <summary> |
| | | 11 | | /// Represents an exception that occurs when the service lease has been lost. |
| | | 12 | | /// </summary> |
| | | 13 | | public class LeaseLostException : Exception |
| | | 14 | | { |
| | | 15 | | readonly string partitionId; |
| | | 16 | | |
| | | 17 | | /// <summary> |
| | | 18 | | /// Provides |
| | | 19 | | /// </summary> |
| | | 20 | | public LeaseLostException(string partitionId, Exception innerException) |
| | 0 | 21 | | : base(innerException.Message, innerException) |
| | | 22 | | { |
| | 0 | 23 | | Guard.ArgumentNotNullOrWhiteSpace(nameof(partitionId), partitionId); |
| | 0 | 24 | | this.partitionId = partitionId; |
| | 0 | 25 | | } |
| | | 26 | | |
| | | 27 | | /// <summary> |
| | | 28 | | /// Gets the partition ID where the exception occured. |
| | | 29 | | /// </summary> |
| | 0 | 30 | | public string PartitionId => this.partitionId; |
| | | 31 | | } |
| | | 32 | | } |