コード例 #1
0
        public void ParseError(IErrorData data)
        {
            var pos = data.Start;

            Assert.Throws <FormatException>(() => SymbolAndPowerReader.Read(data.Text, ref pos));
            Assert.AreEqual(data.ExpectedEnd, pos);
        }
コード例 #2
0
        public void TryTokenizeError(IErrorData data)
        {
            var pos = data.Start;
            IReadOnlyList <SymbolAndPower> actual;
            var success = SymbolAndPowerReader.TryRead(data.Text, ref pos, out actual);

            Assert.AreEqual(false, success);
            Assert.AreEqual(data.Start, pos);
            CollectionAssert.AreEqual(null, actual);
        }
コード例 #3
0
        public void TryParseError(IErrorData data)
        {
            var            pos = data.Start;
            SymbolAndPower sap;
            var            success = SymbolAndPowerReader.TryRead(data.Text, ref pos, out sap);

            Assert.AreEqual(false, success);
            Assert.AreEqual(default(SymbolAndPower), sap);
            Assert.AreEqual(data.ExpectedEnd, pos);
        }
コード例 #4
0
        internal ErrorMargin(ITextView textView, IErrorData errorData)
        {
            _textView                            = textView;
            _errorData                           = errorData;
            _errorMarginControl                  = new ErrorMarginControl();
            _errorMarginControl.Visibility       = Visibility.Collapsed;
            _errorMarginControl.IgnoreError     += OnIgnoreError;
            _errorMarginControl.IgnoreAllErrors += OnIgnoreAllErrors;

            _errorData.ErrorThrown  += OnErrorThrown;
            _errorData.ErrorIgnored += OnErrorIgnored;
            _textView.Closed        += OnTextViewClosed;
        }
コード例 #5
0
        internal ErrorMargin(ITextView textView, IErrorData errorData)
        {
            _textView = textView;
            _errorData = errorData;
            _errorMarginControl = new ErrorMarginControl();
            _errorMarginControl.Visibility = Visibility.Collapsed;
            _errorMarginControl.IgnoreError += OnIgnoreError;
            _errorMarginControl.IgnoreAllErrors += OnIgnoreAllErrors;

            _errorData.ErrorThrown += OnErrorThrown;
            _errorData.ErrorIgnored += OnErrorIgnored;
            _textView.Closed += OnTextViewClosed;
        }
コード例 #6
0
        public IActionResult Error()
        {
            var context   = HttpContext.Features.Get <IExceptionHandlerFeature>();
            var exception = context?.Error;

            if (exception is null)
            {
                return(NotFound());
            }

            IErrorData error = _exceptionMapper.Map(exception);

            _logger.LogError(exception, error.Message);

            var model = new ErrorVM
            {
                Message = error.Message,
                Data    = error.Data
            };

            return(StatusCode(error.StatusCode, model));
        }
コード例 #7
0
ファイル: Errors.cs プロジェクト: mousetail/MouseEngine
 public UnformatableObjectException(string message, List<string> data)
     : base(message)
 {
     dat = new UnfData(data);
 }
コード例 #8
0
ファイル: Errors.cs プロジェクト: mousetail/MouseEngine
 public UnformatableObjectException(string message)
     : base(message)
 {
     dat = null;
 }
コード例 #9
0
 internal ErrorMarginFactory(IErrorData errorData)
 {
     _errorData = errorData;
 }
コード例 #10
0
ファイル: ErrorInfo.cs プロジェクト: JanJorgensen/StepBro
 public ErrorInfo(IScriptFile script, IErrorData parsingError) :
     this(ErrorType.ParsingError, parsingError.JustWarning ? "Warning" : "Error", parsingError.Message, script.FilePath, parsingError.Line)
 {
 }
コード例 #11
0
 internal ErrorMarginFactory(IErrorData errorData)
 {
     _errorData = errorData;
 }