use of org.mule.runtime.api.metadata.resolving.MetadataFailure in project mule by mulesoft.
the class MetadataOutputDelegate method resolveOutputAttributesMetadata.
private MetadataResult<MetadataType> resolveOutputAttributesMetadata(MetadataContext context, Object key, Function<MetadataType, Boolean> metadataValidator) {
try {
MetadataType metadata = resolverFactory.getOutputAttributesResolver().getAttributesType(context, key);
if (metadataValidator.apply(metadata)) {
return success(metadata);
}
MetadataFailure failure = newFailure().withMessage("Error resolving Output Attributes metadata").withFailureCode(NO_DYNAMIC_TYPE_AVAILABLE).withReason(NULL_TYPE_ERROR).onOutputAttributes();
return failure(failure);
} catch (Exception e) {
return failure(newFailure(e).onOutputAttributes());
}
}
Aggregations