Skip to content

Commit ae712f7

Browse files
Tadasbergmeister
andauthored
Add exception message for missing rules (#1968)
* Add exception message for missing rules * Apply suggestions from code review --------- Co-authored-by: Christoph Bergmeister <[email protected]>
1 parent e849068 commit ae712f7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: Engine/ScriptAnalyzer.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -822,13 +822,13 @@ private void Initialize(
822822
// Ensure that rules were actually loaded
823823
if (rules == null || rules.Any() == false)
824824
{
825+
string errorMessage = string.Format(CultureInfo.CurrentCulture, Strings.RulesNotFound);
826+
825827
this.outputWriter.ThrowTerminatingError(
826828
new ErrorRecord(
827-
new Exception(),
828-
string.Format(
829-
CultureInfo.CurrentCulture,
830-
Strings.RulesNotFound),
831-
ErrorCategory.ResourceExists,
829+
new Exception(errorMessage),
830+
errorMessage,
831+
ErrorCategory.ObjectNotFound,
832832
this));
833833
}
834834

0 commit comments

Comments
 (0)