Show errors from loading shared data table when decompiling

This commit is contained in:
Yoshi Askharoun
2025-01-29 10:58:05 -06:00
parent bde7340b0a
commit c34aae8212
2 changed files with 15 additions and 3 deletions
+14 -2
View File
@@ -46,7 +46,10 @@ public class DecompileCommand : CompilerCommandBase<DecompileCommand.Settings>
}
}
BeginErrorReporting(new IrisSourceRepository(enumeratedInputs));
var repoSources = enumeratedInputs.ToList();
if (settings.DataTable is not null)
repoSources.Add(settings.DataTable);
BeginErrorReporting(new IrisSourceRepository(repoSources));
var loadAssembliesResult = LoadAssemblies(settings);
if (loadAssembliesResult < 0)
@@ -68,7 +71,10 @@ public class DecompileCommand : CompilerCommandBase<DecompileCommand.Settings>
{
dataTableLoadResult = LoadIrisFile(settings.DataTable, settings);
if (dataTableLoadResult.Status != LoadResultStatus.Success)
throw new Exception($"Failed to load data table from {dataTableLoadResult.ErrorContextUri}");
{
AnsiConsole.MarkupLineInterpolated($"[red]Failed to load shared data table from {dataTableLoadResult.ErrorContextUri}[/]");
goto done;
}
}
if (settings.Language == SourceLanguage.Asm)
@@ -106,6 +112,12 @@ public class DecompileCommand : CompilerCommandBase<DecompileCommand.Settings>
AnsiConsole.MarkupLine($"[red]{settings.Language} is not currently a supported decompilation target.[/]");
}
done:
StopErrorReporting();
Report?.Render(AnsiConsole.Console);
AnsiConsole.WriteLine();
AnsiConsole.WriteLine();
if (!success)
{
AnsiConsole.MarkupLine("[red]Decompilation failed.[/]");
+1 -1
View File
@@ -17,7 +17,7 @@ internal class Program
config.AddCommand<DecompileCommand>("decompile")
.WithAlias("d")
.WithDescription("Decompiles the given compiled UIX to a source langauge.");
.WithDescription("Decompiles the given compiled UIX to a source language.");
#if DEBUG
config.PropagateExceptions();