Catch and print exceptions from device constructor.

This commit is contained in:
2019-11-02 01:15:49 +00:00
parent bdc55dd648
commit 438fa1c9a2
11 changed files with 754 additions and 565 deletions

View 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; }
}
}