namespace AspClassic.Scripting; public class ErrorSink { public static readonly ErrorSink Default = new ErrorSink(); public static readonly ErrorSink Null = new NullErrorSink(); protected ErrorSink() { } public virtual void Add(SourceUnit source, string message, SourceSpan span, int errorCode, Severity severity) { if (severity == Severity.FatalError || severity == Severity.Error) { throw new SyntaxErrorException(message, source, span, errorCode, severity); } } public virtual void Add(string message, string path, string code, string line, SourceSpan span, int errorCode, Severity severity) { if (severity == Severity.FatalError || severity == Severity.Error) { throw new SyntaxErrorException(message, path, code, line, span, errorCode, severity); } } }