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;
}