Skip to content
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

WIP Fix Remove empty catch block. #985

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