mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Refactor IMediaImage.Open to return error status instead of boolean.
This commit is contained in:
@@ -69,7 +69,7 @@ namespace Aaru.Core.Devices.Dumping
|
||||
double minSpeed = double.MaxValue;
|
||||
byte[] readBuffer;
|
||||
Modes.DecodedMode? decMode = null;
|
||||
Dictionary<MediaTagType, byte[]> mediaTags = new Dictionary<MediaTagType, byte[]>();
|
||||
Dictionary<MediaTagType, byte[]> mediaTags = new();
|
||||
byte[] cmdBuf;
|
||||
bool ret;
|
||||
|
||||
@@ -694,10 +694,11 @@ namespace Aaru.Core.Devices.Dumping
|
||||
var filters = new FiltersList();
|
||||
IFilter filter = filters.GetFilter(_outputPath);
|
||||
IMediaImage inputPlugin = ImageFormat.Detect(filter);
|
||||
ErrorNumber opened = inputPlugin.Open(filter);
|
||||
|
||||
if(!inputPlugin.Open(filter))
|
||||
if(opened != ErrorNumber.NoError)
|
||||
{
|
||||
StoppingErrorMessage?.Invoke("Could not open created image.");
|
||||
StoppingErrorMessage?.Invoke($"Error {opened} opening created image.");
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -733,7 +734,7 @@ namespace Aaru.Core.Devices.Dumping
|
||||
sidecar = _preSidecar;
|
||||
}
|
||||
|
||||
List<(ulong start, string type)> filesystems = new List<(ulong start, string type)>();
|
||||
List<(ulong start, string type)> filesystems = new();
|
||||
|
||||
if(sidecar.BlockMedia[0].FileSystemInformation != null)
|
||||
filesystems.AddRange(from partition in sidecar.BlockMedia[0].FileSystemInformation
|
||||
|
||||
Reference in New Issue
Block a user