Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb407e8e

Browse files
travisclagronebergmeister
authored andcommitted
Actionabilize errors from incorrect settings files (#1263)
* Annotatively research current state of exception handling surrounding settings file load invocation* Throw a contextful terminating error if processing the argument of 'Invoke-ScriptAnalyzer -Settings' results in an exception* Refine id and category of error for when processing value of `Invoke-ScriptAnalyzer -Settings` results in an exception* Revert "Annotatively research current state of exception handling surrounding settings file load invocation"This reverts commit3bfd45b.* Do not attempt id and category inference for the error to throw when processing the argument of `Invoke-ScriptAnalyzer -Settings` results in an exception* Remove `using System.IO`* Revert "Remove `using System.IO`"This reverts commit88ab1ec.`using System.IO` is required in Engine\Settings.cs after all. The mainuse is for pre-existing unqualified references to the typeInvalidDataException.* Remove unused using after refactoring. Use more descriptive variable name and make error record arguments consistent with usage in other parts of the solution.
1 parentfd7663e commitb407e8e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

‎Engine/Commands/InvokeScriptAnalyzerCommand.cs‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -325,11 +325,13 @@ protected override void BeginProcessing()
325325
?rulePaths
326326
:rulePaths.Concat(settingsCustomRulePath).ToArray();
327327
}
328-
catch
328+
catch(Exceptionexception)
329329
{
330-
this.WriteWarning(String.Format(CultureInfo.CurrentCulture,Strings.SettingsNotParsable));
331-
stopProcessing=true;
332-
return;
330+
this.ThrowTerminatingError(newErrorRecord(
331+
exception,
332+
"SETTINGS_ERROR",
333+
ErrorCategory.InvalidData,
334+
this.settings));
333335
}
334336

335337
ScriptAnalyzer.Instance.Initialize(
@@ -357,7 +359,7 @@ protected override void ProcessRecord()
357359
{
358360
ProcessPath();
359361
}
360-
362+
361363
#if!PSV3
362364
// TODO Support dependency resolution for analyzing script definitions
363365
if(saveDscDependency)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp