// Handler used for both compiler and story errors void OnError(string message, Ink.ErrorType errorType) { ConsoleColor color = ConsoleColor.Red; if (errorType == ErrorType.Warning) { color = ConsoleColor.Blue; } else if (errorType == ErrorType.Author) { color = ConsoleColor.Green; } Console.ForegroundColor = color; Console.WriteLine(message); Console.ResetColor(); }
void OnError(string message, Ink.ErrorType errorType) { switch (errorType) { case ErrorType.Author: _authorMessages.Add(message); break; case ErrorType.Warning: _warnings.Add(message); break; case ErrorType.Error: _errors.Add(message); break; } }
// Handler used for both compiler and story errors void OnError(string message, Ink.ErrorType errorType) { ConsoleColor color = ConsoleColor.Red; if (errorType == ErrorType.Warning) { color = ConsoleColor.Blue; } else if (errorType == ErrorType.Author) { color = ConsoleColor.Green; } Console.ForegroundColor = color; Console.WriteLine(message); Console.ResetColor(); // Throw an exception so we can get a callstack right here throw new SystemException(errorType.ToString() + ": " + message); }