34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using System;
|
|
|
|
namespace LibNftables;
|
|
|
|
/// <summary>
|
|
/// Base exception for managed nftables failures.
|
|
/// </summary>
|
|
public class NftException : InvalidOperationException
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new exception instance.
|
|
/// </summary>
|
|
/// <param name="message">Error message.</param>
|
|
/// <param name="nativeErrorCode">Native error code, when available.</param>
|
|
/// <param name="nativeErrorOutput">Native error output, when available.</param>
|
|
/// <param name="innerException">Optional inner exception.</param>
|
|
public NftException(string message, int nativeErrorCode = 0, string? nativeErrorOutput = null, Exception? innerException = null)
|
|
: base(message, innerException)
|
|
{
|
|
NativeErrorCode = nativeErrorCode;
|
|
NativeErrorOutput = nativeErrorOutput;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the native error code.
|
|
/// </summary>
|
|
public int NativeErrorCode { get; }
|
|
|
|
/// <summary>
|
|
/// Gets native error output text.
|
|
/// </summary>
|
|
public string? NativeErrorOutput { get; }
|
|
}
|