Refactor IMediaImage.Open to return error status instead of boolean.

This commit is contained in:
2021-09-16 19:10:39 +01:00
parent ac275aa8cb
commit ef2fc1788a
86 changed files with 699 additions and 512 deletions

View File

@@ -64,10 +64,11 @@ namespace Aaru.Core.Devices.Dumping
IFilter filter = filters.GetFilter(_outputPath);
IMediaImage inputPlugin = ImageFormat.Detect(filter);
totalChkDuration = 0;
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;
}
@@ -101,7 +102,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.OpticalDisc[0].Track != null)
filesystems.AddRange(from xmlTrack in sidecar.OpticalDisc[0].Track