Skip to content

Commit

Permalink
Improve conversion error reporting
Browse files Browse the repository at this point in the history
When doing ConnID -> midPoint resource object conversion we now
log SchemaExceptions more precisely. This is related to MID-5004.
  • Loading branch information
mederly committed Aug 28, 2019
1 parent fd2e8d2 commit bba588d
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -327,8 +327,7 @@ <T extends ShadowType> PrismObject<T> convertToResourceObject(ConnectorObject co
ObjectClassComplexTypeDefinition ocDef = attributesContainerDefinition.getComplexTypeDefinition();
ResourceAttributeDefinition<String> uidDefinition = ConnIdUtil.getUidDefinition(ocDef);
if (uidDefinition == null) {
throw new SchemaException("No definition for ConnId UID attribute found in definition "
+ ocDef);
throw new SchemaException("No definition for ConnId UID attribute found in definition " + ocDef);
}
if (attributesContainer.getValue().findItem(uidDefinition.getItemName()) == null) {
ResourceAttribute<String> uidRoa = uidDefinition.instantiate();
Expand All @@ -337,7 +336,10 @@ <T extends ShadowType> PrismObject<T> convertToResourceObject(ConnectorObject co
}

return shadowPrism;

} catch (SchemaException e) {
result.recordFatalError(e);
throw new SchemaException("Couldn't convert resource object from ConnID to midPoint: uid=" + co.getUid() + ", name="
+ co.getName() + ", class=" + co.getObjectClass() + ": " + e.getMessage(), e);
} catch (Throwable t) {
result.recordFatalError(t);
throw t;
Expand Down

0 comments on commit bba588d

Please sign in to comment.