Skip to content

Commit

Permalink
SED-937 add error handling for dependency tree visitor hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
david-stephan committed Mar 10, 2022
1 parent 9d8f560 commit e24a77d
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,14 @@ private void resolveEntityDependencies(Object entity, EntityTreeVisitorContext c
EntityTreeVisitor visitor = context.getVisitor();
BeanInfo beanInfo = getBeanInfo(entity.getClass(), visitor);

entityManager.getDependencyTreeVisitorHooks().forEach(h -> h.onVisitEntity(entity, context));
entityManager.getDependencyTreeVisitorHooks().forEach(h -> {
try {
h.onVisitEntity(entity, context);
} catch (Exception e) {
visitor.onWarning("TreeVisitorHook failed for entitiy " + entity.getClass() + ", error: " + e.getMessage());
}

});

for (PropertyDescriptor descriptor : beanInfo.getPropertyDescriptors()) {
Method method = descriptor.getReadMethod();
Expand Down

0 comments on commit e24a77d

Please sign in to comment.