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

@@ -232,7 +232,7 @@ namespace Aaru.Commands.Filesystem
try
{
bool opened = false;
ErrorNumber opened = ErrorNumber.NoData;
Core.Spectre.ProgressSingleSpinner(ctx =>
{
@@ -240,12 +240,12 @@ namespace Aaru.Commands.Filesystem
opened = imageFormat.Open(inputFilter);
});
if(!opened)
if(opened != ErrorNumber.NoError)
{
AaruConsole.WriteLine("Unable to open image format");
AaruConsole.WriteLine("No error given");
AaruConsole.WriteLine("Error {0}", opened);
return (int)ErrorNumber.CannotOpenFormat;
return (int)opened;
}
AaruConsole.DebugWriteLine("Extract-Files command", "Correctly opened image file.");