using k8s.Models;
using System;
using System.Runtime.Serialization;
namespace k8s
{
///
/// Represents an error message returned by the Kubernetes API server.
///
public class KubernetesException : Exception
{
///
/// Initializes a new instance of the class.
///
public KubernetesException()
{
}
///
/// Initializes a new instance of the class.
/// Initializes a ne winstance of the class using
/// the data from a object.
///
///
/// A status message which triggered this exception to be thrown.
///
public KubernetesException(V1Status status)
: this(status?.Message)
{
Status = status;
}
///
/// Initializes a new instance of the class with an error message.
///
///
/// The error message that explains the reason for the exception.
///
public KubernetesException(string message)
: base(message)
{
}
///
/// Initializes a new instance of the class with a specified error
/// message and a reference to the inner exception that is the cause of this exception.
///
///
/// The error message that explains the reason for the exception.
///
///
/// The exception that is the cause of the current exception, or
/// if no inner exception is specified.
///
public KubernetesException(string message, Exception innerException)
: base(message, innerException)
{
}
///
/// Initializes a new instance of the class with serialized data.
///
///
/// The that holds the serialized
/// object data about the exception being thrown.
///
///
/// The that contains contextual information
/// about the source or destination.
///
protected KubernetesException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
///
/// Gets, when this exception was raised because of a Kubernetes status message, the underlying
/// Kubernetes status message.
///
public V1Status Status { get; private set; }
}
}