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:
@@ -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.");
|
||||
|
||||
Reference in New Issue
Block a user