Refactored error handling

Now uses base error class which has an abstract function for overiding how it is displayed to the console.
This commit is contained in:
Pasha Bibko
2025-05-05 15:44:59 +01:00
parent a16ce34c8b
commit 616ed1ca21
26 changed files with 340 additions and 243 deletions

View File

@@ -45,11 +45,10 @@ namespace LX_Build
LX_API.Init();
// Generates LLVM IR with the example files //
int genExitCode = LX_API.GenIR("example/main.lx", "example/main.ll", "example/log");
if (genExitCode != 0)
if (LX_API.GenIR("example/main.lx", "example/main.ll", "example/log") != 0)
{
Console.WriteLine("An error occured whilst generating LLVM IR");
Console.WriteLine($"Error code: {genExitCode}");
// Quits if the IR Generation fails //
// The C++ script handles all of the error message outputting //
return;
}