Example #1
0
 protected void OnScannerError(CssException exc)
 {
     if (ScannerError != null)
     {
         ScannerError(this, new CssScannerErrorEventArgs(exc));
     }
 }
Example #2
0
 public CssScannerErrorEventArgs(CssException exc)
 {
     Exception = exc;
 }
Example #3
0
        private void ReportError(int severity, CssErrorCode errorNumber, CssContext context, params object[] arguments)
        {
            // guide: 0 == syntax error
            //        1 == the programmer probably did not intend to do this
            //        2 == this can lead to problems in the future.
            //        3 == this can lead to performance problems
            //        4 == this is just not right

            string message = CssStrings.ResourceManager.GetString(errorNumber.ToString(), CssStrings.Culture).FormatInvariant(arguments);
            var exc = new CssException(
                (int)errorNumber,
                CssStrings.ParserSubsystem,
                severity,
                (context != null) ? context.Start.Line : 0,
                (context != null) ? context.Start.Char : 0,
                message);

            // but warnings we want to just report and carry on
            OnCssError(exc);
        }
Example #4
0
        protected void OnCssError(CssException exception)
        {
            if (CssError != null && exception != null && !Settings.IgnoreAllErrors)
            {
                // format our CSS error code
                string errorCode = "CSS{0}".FormatInvariant((exception.Error & (0xffff)));

                // if we have no errors in our error ignore list, or if we do but this error code is not in
                // that list, fire the event to whomever is listening for it.
                if (!Settings.IgnoreErrorCollection.Contains(errorCode))
                {
                    CssError(this, new CssErrorEventArgs(exception,
                        new MinifierError(
                            exception.Severity < 2,
                            exception.Severity,
                            GetSeverityString(exception.Severity),
                            errorCode,
                            null,
                            FileContext,
                            exception.Line,
                            exception.Char,
                            0,
                            0,
                            exception.Message)));
                }
            }
        }
Example #5
0
 internal CssErrorEventArgs(CssException exc, MinifierError error)
 {
     Error = error;
     Exception = exc;
 }