[Console] Use Spectre.Console to show exceptions in the CLI.

GUI still uses `ConsoleWindow`.
This commit is contained in:
2023-10-08 04:10:19 +01:00
parent dccfa1c4ad
commit aa39281033
94 changed files with 343 additions and 133 deletions

View File

@@ -38,6 +38,7 @@ using Aaru.CommonTypes;
using Aaru.CommonTypes.AaruMetadata;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Structs;
using Aaru.Console;
using Aaru.Helpers;
namespace Aaru.Images;
@@ -82,9 +83,10 @@ public sealed partial class DriDiskCopy
{
_writingStream = new FileStream(path, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None);
}
catch(IOException e)
catch(IOException ex)
{
ErrorMessage = string.Format(Localization.Could_not_create_new_image_file_exception_0, e.Message);
ErrorMessage = string.Format(Localization.Could_not_create_new_image_file_exception_0, ex.Message);
AaruConsole.WriteException(ex);
return false;
}