Skip to content

WIP Fix Remove empty catch block. #985

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions Rules/UseIdenticalMandatoryParametersDSC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,21 +241,14 @@ private IDictionary<string, string> GetKeys(string fileName)
var errors = new System.Collections.ObjectModel.Collection<Exception>();
var keys = new List<string>();
List<CimClass> cimClasses = null;
try
if (!isDSCClassCacheInitialized)
{
if (!isDSCClassCacheInitialized)
{
DscClassCache.Initialize();
isDSCClassCacheInitialized = true;
}

cimClasses = dscClassImporter(mofFilepath, moduleInfo, errors);
}
catch
{
// todo log the error
DscClassCache.Initialize();
isDSCClassCacheInitialized = true;
}

cimClasses = dscClassImporter(mofFilepath, moduleInfo, errors);

var cimClass = cimClasses?.FirstOrDefault();
var cimSuperClassProperties = new HashSet<string>(
cimClass?.CimSuperClass?.CimClassProperties.Select(cimPropertyDeclaration => cimPropertyDeclaration.Name) ??
Expand Down