- Add custom exceptions

This commit is contained in:
Stone_Red
2022-01-13 15:01:41 +01:00
parent 4bef308ff2
commit 0fc0a1fe46
@@ -165,5 +165,17 @@ namespace YesNt.Interpreter.Statements
RuntimeInfo.Exit("Planned termination by code. Canceling all tasks", true);
}
[Statement("trw", SearchMode.StartOfLine, SpaceAround.End, ConsoleColor.Red)]
public void Throw(string message)
{
RuntimeInfo.Exit(message, true);
}
[Statement("err", SearchMode.StartOfLine, SpaceAround.End, ConsoleColor.Red)]
public void Error(string message)
{
RuntimeInfo.Exit(message, false);
}
}
}