Add exception message for missing rules by Tadas · Pull Request #1968 · PowerShell/PSScriptAnalyzer

CultureInfo.CurrentCulture,
Strings.RulesNotFound),
ErrorCategory.ResourceExists,
new Exception(errorMessage),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where this error is thrown, are we sure the only reason could be missing rules @Tadas ?
Kicked off CI for now to see what tests say

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bergmeister I know we didn't get an answer to this; thoughts on merging for v1.3?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, on closer inspection of the diff, only 2 things are changing and they aren't of concern:

  • errorMessage is passed into Exception instead of nothing, which is an improvement
  • ErrorCategory is changed from ResourceExists to ResourceUnavailable, which I guess is a bit better but ObjectNotFound is maybe even better so will change it to that. This is the same category that gci notExists returns