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

LogUnhandledExceptionInitializingRule() public static method

public static LogUnhandledExceptionInitializingRule ( IAnalysisContext context, Exception exception ) : void
context IAnalysisContext
exception System.Exception
return void
        public static void LogUnhandledExceptionInitializingRule(IAnalysisContext context, Exception exception)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            // An unhandled exception was encountered initializing check '{0}', which
            // has been disabled for the remainder of the analysis.
            context.Logger.LogToolNotification(
                CreateNotification(
                context.TargetUri,
                ERR998_ExceptionInInitialize,
                context.Rule.Id,
                NotificationLevel.Error,
                exception,
                true,
                context.Rule.Name));

            context.RuntimeErrors |= RuntimeConditions.ExceptionInSkimmerInitialize;
        }