mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Use error number for device instead of exception.
This commit is contained in:
@@ -724,25 +724,25 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
||||
|
||||
UpdateStatus("Opening device...");
|
||||
|
||||
try
|
||||
{
|
||||
_dev = Device.Create(_devicePath);
|
||||
_dev = Device.Create(_devicePath, out ErrorNumber devErrno);
|
||||
|
||||
if(_dev is Devices.Remote.Device remoteDev)
|
||||
switch(_dev)
|
||||
{
|
||||
case null:
|
||||
StoppingErrorMessage($"Error {devErrno} opening device.");
|
||||
|
||||
return;
|
||||
case Devices.Remote.Device remoteDev:
|
||||
Statistics.AddRemote(remoteDev.RemoteApplication, remoteDev.RemoteVersion,
|
||||
remoteDev.RemoteOperatingSystem, remoteDev.RemoteOperatingSystemVersion,
|
||||
remoteDev.RemoteArchitecture);
|
||||
|
||||
if(_dev.Error)
|
||||
{
|
||||
StoppingErrorMessage($"Error {_dev.LastError} opening device.");
|
||||
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
catch(Exception exception)
|
||||
|
||||
if(_dev.Error)
|
||||
{
|
||||
StoppingErrorMessage($"Exception {exception.Message} opening device.");
|
||||
StoppingErrorMessage($"Error {_dev.LastError} opening device.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user