CimDscParser: Add better error message when a file is not found (#5838)
This commit is contained in:
parent
a08f3241a3
commit
db10411505
|
@ -368,7 +368,8 @@ namespace Microsoft.PowerShell.DesiredStateConfiguration
|
||||||
|
|
||||||
if (!File.Exists(fullFilePath))
|
if (!File.Exists(fullFilePath))
|
||||||
{
|
{
|
||||||
throw PSTraceSource.NewArgumentException("fullFilePath");
|
var errorMessage = string.Format(CultureInfo.CurrentCulture, ParserStrings.FileNotFound, fullFilePath);
|
||||||
|
throw PSTraceSource.NewArgumentException(nameof(fullFilePath), errorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
using (FileStream fs = File.OpenRead(fullFilePath))
|
using (FileStream fs = File.OpenRead(fullFilePath))
|
||||||
|
|
Loading…
Reference in a new issue