Skip to content

Commit

Permalink
Add diagnostics for missing schema handling parts
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Jan 8, 2020
1 parent 7b10132 commit 219818b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Expand Up @@ -1188,11 +1188,10 @@ public static String debugDump(int indent, LayerType layer, RefinedObjectClassDe
sb.append(",default");
}
if (_this.getKind() != null) {
sb.append(" ").append(_this.getKind().value());
sb.append(",kind=").append(_this.getKind().value());
}
sb.append(",");
if (_this.getIntent() != null) {
sb.append("intent=").append(_this.getIntent());
sb.append(",intent=").append(_this.getIntent());
}
if (layer != null) {
sb.append(",layer=").append(layer);
Expand Down
Expand Up @@ -115,6 +115,9 @@ public static String refineProjectionIntent(ShadowKindType kind, String intent,
RefinedResourceSchema refinedSchema = RefinedResourceSchemaImpl.getRefinedSchema(resource, LayerType.MODEL, prismContext);
RefinedObjectClassDefinition rObjClassDef = refinedSchema.getRefinedDefinition(kind, intent);
if (rObjClassDef == null) {
LOGGER.error("No projection definition for kind={}, intent={} in {}", kind, intent, resource);
LOGGER.error("Diagnostic output follows:\n\nResource:\n{}\n\nRefined resource schema:\n{}",
resource.asPrismObject().debugDump(), refinedSchema.debugDump());
throw new SchemaException("No projection definition for kind="+kind+" intent="+intent+" in "+resource);
}
return rObjClassDef.getIntent();
Expand Down

0 comments on commit 219818b

Please sign in to comment.