FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

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

Add exception message for missing rules - #1968

Merged
Andy Jordan (andyleejordan) merged 5 commits into
PowerShell:mainfrom
Tadas:clearer-exception-message
Mar 14, 2025
Merged

Add exception message for missing rules#1968
Andy Jordan (andyleejordan) merged 5 commits into
PowerShell:mainfrom
Tadas:clearer-exception-message

Conversation

Copy link
Copy Markdown
Contributor

PR Summary

Fixes #1875

PR Checklist

Comment thread Engine/ScriptAnalyzer.cs
CultureInfo.CurrentCulture,
Strings.RulesNotFound),
ErrorCategory.ResourceExists,
new Exception(errorMessage),

Christoph Bergmeister (bergmeister) Feb 17, 2025
edited
Loading

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Andy Jordan (andyleejordan) merged commit ae712f7 into PowerShell:main Mar 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get-ScriptAnalyzerRule throws "Exception of type 'System.Exception' was thrown." when path does not contain rules

3 participants


Back | FazBrowse Home | New Git URL