Microsoft.CodeAnalysis.Sarif.Errors.LogUnhandledRuleExceptionAnalyzingTarget C# (CSharp) Method

LogUnhandledRuleExceptionAnalyzingTarget() public static method

public static LogUnhandledRuleExceptionAnalyzingTarget ( HashSet disabledSkimmers, IAnalysisContext context, Exception exception ) : RuntimeConditions
disabledSkimmers HashSet
context IAnalysisContext
exception System.Exception
return RuntimeConditions
        public static RuntimeConditions LogUnhandledRuleExceptionAnalyzingTarget(
            HashSet<string> disabledSkimmers,
            IAnalysisContext context,
            Exception exception)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            // An unhandled exception was encountered analyzing '{0}' for check '{1}',
            // which has been disabled for the remainder of the analysis.The
            // exception may have resulted from a problem related to parsing
            // image metadata and not specific to the rule, however.
            context.Logger.LogToolNotification(
                CreateNotification(
                    context.TargetUri,
                    ERR998_ExceptionInAnalyze,
                    context.Rule.Id,
                    NotificationLevel.Error,
                    exception,
                    true,
                    context.TargetUri.GetFileName(),
                    context.Rule.Name));

            if (disabledSkimmers != null) { disabledSkimmers.Add(context.Rule.Id); }

            return RuntimeConditions.ExceptionInSkimmerAnalyze;
        }