-
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathAzureResourceNotFoundException.cs
More file actions
35 lines (31 loc) · 1.4 KB
/
Copy pathAzureResourceNotFoundException.cs
File metadata and controls
35 lines (31 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using ModularPipelines.Azure.Scopes;
namespace ModularPipelines.Azure.Exceptions;
/// <summary>
/// Exception thrown when an Azure resource cannot be found.
/// </summary>
public class AzureResourceNotFoundException : InvalidOperationException
{
/// <summary>
/// Gets the Azure resource identifier that was not found.
/// </summary>
public AzureResourceIdentifier ResourceIdentifier { get; }
/// <summary>
/// Initializes a new instance of the <see cref="AzureResourceNotFoundException"/> class.
/// </summary>
/// <param name="resourceIdentifier">The Azure resource identifier that was not found.</param>
public AzureResourceNotFoundException(AzureResourceIdentifier resourceIdentifier)
: base($"Azure resource not found: {resourceIdentifier}")
{
ResourceIdentifier = resourceIdentifier;
}
/// <summary>
/// Initializes a new instance of the <see cref="AzureResourceNotFoundException"/> class.
/// </summary>
/// <param name="resourceIdentifier">The Azure resource identifier that was not found.</param>
/// <param name="innerException">The inner exception that caused this exception.</param>
public AzureResourceNotFoundException(AzureResourceIdentifier resourceIdentifier, Exception? innerException)
: base($"Azure resource not found: {resourceIdentifier}", innerException)
{
ResourceIdentifier = resourceIdentifier;
}
}