Centralize exit messages in ExitMessages class

This commit is contained in:
Stone_Red
2026-03-04 20:32:25 +01:00
parent 3411bb88de
commit 10d5766873
12 changed files with 99 additions and 63 deletions
@@ -23,7 +23,7 @@ internal partial class ProcessingStatements : StatementRuntimeInformation
string res = Evaluator.Calculate(matches[i].Value);
if (res is null)
{
RuntimeInfo.Exit("Invalid operation", true);
RuntimeInfo.Exit(ExitMessages.InvalidOperation, true);
return;
}
args = args.FromSafeString().Replace(matches[i].Value, res);
@@ -65,7 +65,7 @@ internal partial class ProcessingStatements : StatementRuntimeInformation
}
else
{
RuntimeInfo.Exit($"\"{args}\" is not a valid time-out value", true);
RuntimeInfo.Exit(ExitMessages.InvalidTimeoutValue(args), true);
}
}
@@ -104,12 +104,12 @@ internal partial class ProcessingStatements : StatementRuntimeInformation
}
catch
{
RuntimeInfo.Exit($"Could not load file \"{path}\"", true);
RuntimeInfo.Exit(ExitMessages.CouldNotLoadFile(path), true);
}
}
else
{
RuntimeInfo.Exit($"Could not find file \"{path}\"", true);
RuntimeInfo.Exit(ExitMessages.CouldNotFindFile(path), true);
}
}