Skip to content

Commit

Permalink
improve error on missing default CTor
Browse files Browse the repository at this point in the history
  • Loading branch information
paullatzelsperger committed Nov 12, 2024
1 parent 39270bc commit 90c0ed0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,14 @@ public Object resolve(ServiceExtensionContext context, DefaultServiceSupplier de
field.setAccessible(true);
field.set(instance, fe.value());
} catch (IllegalAccessException | NoSuchFieldException e) {
throw new RuntimeException(e);
throw new EdcInjectionException(e);
}
});

return instance;
} catch (ClassNotFoundException | NoSuchMethodException | InstantiationException | IllegalAccessException |
} catch (NoSuchMethodException e) {
throw new EdcInjectionException("Configuration objects must declare a default constructor, but '%s' does not.".formatted(configurationObject.getType()));
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException |
InvocationTargetException e) {
throw new EdcInjectionException(e);
}
Expand Down

0 comments on commit 90c0ed0

Please sign in to comment.