Skip to content

Commit

Permalink
refactor(core): move module not found log message to trace
Browse files Browse the repository at this point in the history
- We have many attributes without modules, there is no reason
  to log that we don't have a module for them.
- Fixed typos in exception messages when retrieving modules.
  • Loading branch information
zlamalp committed Nov 3, 2023
1 parent 1d3e163 commit 2c65971
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4340,7 +4340,7 @@ private GroupAttributesModuleImplApi getGroupAttributeModule(PerunSession sess,
if (attributeModule instanceof GroupAttributesModuleImplApi) {
return (GroupAttributesModuleImplApi) attributeModule;
} else {
throw new WrongModuleTypeException("Required attribute module isn't FacilityAttributesModule");
throw new WrongModuleTypeException("Required attribute module isn't GroupAttributesModule");
}
}

Expand Down Expand Up @@ -4376,7 +4376,7 @@ private VoAttributesModuleImplApi getVoAttributeModule(PerunSession sess, Attrib
if (attributeModule instanceof VoAttributesModuleImplApi) {
return (VoAttributesModuleImplApi) attributeModule;
} else {
throw new WrongModuleTypeException("Required attribute module isn't FacilityAttributesModule");
throw new WrongModuleTypeException("Required attribute module isn't VoAttributesModule");
}
}

Expand All @@ -4394,7 +4394,7 @@ private MemberResourceAttributesModuleImplApi getResourceMemberAttributeModule(P
if (attributeModule instanceof MemberResourceAttributesModuleImplApi) {
return (MemberResourceAttributesModuleImplApi) attributeModule;
} else {
throw new WrongModuleTypeException("Required attribute module isn't FacilityAttributesModule");
throw new WrongModuleTypeException("Required attribute module isn't ResourceMemberAttributesModule");
}
}

Expand Down Expand Up @@ -4691,7 +4691,7 @@ MemberGroupVirtualAttributesModuleImplApi getMemberGroupVirtualAttributeModule(P
* Get UserExtSource attribute module for the attribute.
*
* @param attribute attribute for which you get the module
* @return instance UserExtSource attribute module, null if the module doesn't exists
* @return instance UserExtSource attribute module, null if the module doesn't exist
*/
private UserExtSourceVirtualAttributesModuleImplApi getUserExtSourceVirtualAttributeModule(PerunSession sess, AttributeDefinition attribute) {
Object attributeModule = getAttributesModule(sess, attribute);
Expand Down Expand Up @@ -4747,7 +4747,7 @@ public Object getAttributesModule(PerunSession sess, AttributeDefinition attribu
//if specific module not exists or attribute has no parameter, find the common one
moduleName = attributeNameToModuleName(attribute.getNamespace() + ":" + attribute.getBaseFriendlyName());
Object attributeModule = attributesModulesMap.get(moduleName);
if (attributeModule == null) log.debug("Attribute module not found. Module name={}", moduleName);
if (attributeModule == null) log.trace("Attribute module not found. Module name={}", moduleName);
return attributeModule;
}

Expand Down

0 comments on commit 2c65971

Please sign in to comment.