mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Catch and print exceptions from device constructor.
This commit is contained in:
24
DiscImageChef.Devices/Device/DeviceException.cs
Normal file
24
DiscImageChef.Devices/Device/DeviceException.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
|
||||
namespace DiscImageChef.Devices
|
||||
{
|
||||
/// <summary>
|
||||
/// Exception to be returned by the device constructor
|
||||
/// </summary>
|
||||
public class DeviceException : Exception
|
||||
{
|
||||
internal DeviceException(string message) : base(message)
|
||||
{
|
||||
}
|
||||
|
||||
internal DeviceException(int lastError)
|
||||
{
|
||||
LastError = lastError;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Last error sent by the operating systen
|
||||
/// </summary>
|
||||
public int LastError { get; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user