public static StatementContext <T> Error( [CanBeNull] string statement, ContextErrorNumber errorNumber, [NotNull] string errorMessage) { return(new StatementContext <T>(statement, errorNumber, errorMessage)); }
public static ProgramContext <T> Error( [CanBeNull] Program program, ContextErrorNumber errorNumber, [NotNull] string errorMessage) { return(new ProgramContext <T>(program, errorNumber, errorMessage)); }
/// <summary> /// Initializes a new instance of the <see cref="StatementContext{T}"/> class. /// </summary> /// <param name="statement">The statement that was evaluated</param> /// <param name="errorNumber">The general category of error that occurred</param> /// <param name="errorMessage">The specific error message that was recorded</param> /// <exception cref="ArgumentNullException">Thrown when a null error message is supplied to this constructor</exception> private StatementContext([CanBeNull] string statement, ContextErrorNumber errorNumber, [NotNull] string errorMessage) : base(errorNumber, errorMessage) { if (string.IsNullOrWhiteSpace(errorMessage)) { throw new ArgumentNullException(nameof(errorMessage)); } this.statement = statement; }
/// <summary> /// Initializes a new instance of the <see cref="ProgramContext{T}"/> class. /// </summary> /// <param name="program">The program that was executed</param> /// <param name="errorNumber">The general category of error that occurred</param> /// <param name="errorMessage">The specific error message that was recorded</param> /// <exception cref="ArgumentNullException">Thrown when a null error message is supplied to this constructor</exception> private ProgramContext([CanBeNull] Program program, ContextErrorNumber errorNumber, [NotNull] string errorMessage) : base(errorNumber, errorMessage) { if (string.IsNullOrWhiteSpace(errorMessage)) { throw new ArgumentNullException(nameof(errorMessage)); } this.program = program; }
/// <summary> /// Initializes a new instance of the <see cref="Context{T}"/> class. /// </summary> /// <param name="errorNumber">The general category of error that occurred</param> /// <param name="errorMessage">The specific error message that was recorded</param> /// <exception cref="ArgumentNullException">Thrown when a null error message is supplied to this constructor</exception> protected Context(ContextErrorNumber errorNumber, [NotNull] string errorMessage) { if (string.IsNullOrWhiteSpace(errorMessage)) { throw new ArgumentNullException(nameof(errorMessage)); } this.ErrorNumber = errorNumber; this.ErrorMessage = errorMessage; this.State = ContextState.Errored; }