-
Notifications
You must be signed in to change notification settings - Fork 301
/
Copy pathKubernetesException.cs
79 lines (74 loc) · 2.93 KB
/
KubernetesException.cs
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
namespace k8s
{
/// <summary>
/// Represents an error message returned by the Kubernetes API server.
/// </summary>
public class KubernetesException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="KubernetesException"/> class.
/// </summary>
public KubernetesException()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="KubernetesException"/> class using
/// the data from a <see cref="V1Status"/> object.
/// </summary>
/// <param name="status">
/// A status message which triggered this exception to be thrown.
/// </param>
public KubernetesException(V1Status status)
: this(status?.Message)
{
Status = status;
}
/// <summary>
/// Initializes a new instance of the <see cref="KubernetesException"/> class using
/// the data from a <see cref="V1Status"/> object and a reference to the inner exception
/// that is the cause of this exception..
/// </summary>
/// <param name="status">
/// A status message which triggered this exception to be thrown.
/// </param>
/// <param name="innerException">
/// The exception that is the cause of the current exception, or <see langword="null"/>
/// if no inner exception is specified.
/// </param>
public KubernetesException(V1Status status, Exception innerException)
: this(status?.Message, innerException)
{
Status = status;
}
/// <summary>
/// Initializes a new instance of the <see cref="KubernetesException"/> class with an error message.
/// </summary>
/// <param name="message">
/// The error message that explains the reason for the exception.
/// </param>
public KubernetesException(string message)
: base(message)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="KubernetesException"/> class with a specified error
/// message and a reference to the inner exception that is the cause of this exception.
/// </summary>
/// <param name="message">
/// The error message that explains the reason for the exception.
/// </param>
/// <param name="innerException">
/// The exception that is the cause of the current exception, or <see langword="null"/>
/// if no inner exception is specified.
/// </param>
public KubernetesException(string message, Exception innerException)
: base(message, innerException)
{
}
/// <summary>
/// Gets, when this exception was raised because of a Kubernetes status message, the underlying
/// Kubernetes status message.
/// </summary>
public V1Status Status { get; private set; }
}
}