Add src files
This commit is contained in:
33
src/LibNftables/NftException.cs
Normal file
33
src/LibNftables/NftException.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
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; }
|
||||
}
|
||||
Reference in New Issue
Block a user