Skip to content

Commit

Permalink
fix: 0 for OK; any 1 for exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Hecate2 committed Feb 26, 2024
1 parent 7add5a9 commit da070ac
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/Neo.Compiler.CSharp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,22 @@ private static int ProcessSources(Options options, string folder, string[] sourc

private static int ProcessOutputs(Options options, string folder, List<CompilationContext> contexts)
{
return contexts.Select(p => ProcessOutput(options, folder, p)).Any(p => p != 1) ? 0 : 1;
int result = 0;
List<Exception> exceptions = new();
foreach (CompilationContext context in contexts)
try
{
if (ProcessOutput(options, folder, context) != 0)
result = 1;
}
catch (Exception e)
{
result = 1;
exceptions.Add(e);
}
foreach (Exception e in exceptions)
Console.Error.WriteLine(e.ToString());
return result;
}

private static int ProcessOutput(Options options, string folder, CompilationContext context)
Expand Down

0 comments on commit da070ac

Please sign in to comment.