Skip to content

Commit

Permalink
✨ Add a dedicated exception type to indicate a missing driver.
Browse files Browse the repository at this point in the history
Having this will allow showing informations in the UI later on.
  • Loading branch information
hexawyz committed Sep 18, 2024
1 parent a444739 commit f59665d
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/Exo/Core/Exo.Core/Discovery/MissingKernelDriverException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace Exo.Discovery;

public sealed class MissingKernelDriverException : Exception
{
public string? DeviceName { get; }

public MissingKernelDriverException()
: base("A kernel driver driver is missing to work with the device.")
{
}

public MissingKernelDriverException(string? deviceName) : this(deviceName, $"A kernel driver is missing to work with the device {deviceName}.")
{
}

public MissingKernelDriverException(string? deviceName, string? message) : base(message)
{
DeviceName = deviceName;
}

public MissingKernelDriverException(string? deviceName, string? message, Exception? innerException) : base(message, innerException)
{
DeviceName = deviceName;
}
}

0 comments on commit f59665d

Please sign in to comment.