From ba34b443d2f65748bfb3716886373872a551fa03 Mon Sep 17 00:00:00 2001 From: Stephan Plath Date: Tue, 14 May 2024 11:08:17 +0200 Subject: [PATCH] add method to exception (#1168) IllegalArgumentException needs some context to be more useful --- .../main/java/io/smallrye/config/ConfigMappingInterface.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/implementation/src/main/java/io/smallrye/config/ConfigMappingInterface.java b/implementation/src/main/java/io/smallrye/config/ConfigMappingInterface.java index 3fa1ab9c3..5547eb479 100644 --- a/implementation/src/main/java/io/smallrye/config/ConfigMappingInterface.java +++ b/implementation/src/main/java/io/smallrye/config/ConfigMappingInterface.java @@ -783,10 +783,10 @@ static Property[] getProperties(Method[] methods, int si, int ti) { continue; } if (method.getParameterCount() > 0) { - throw new IllegalArgumentException("Configuration methods cannot accept parameters"); + throw new IllegalArgumentException("Configuration methods cannot accept parameters: " + method); } if (method.getReturnType() == void.class) { - throw new IllegalArgumentException("Void config methods are not allowed"); + throw new IllegalArgumentException("Void config methods are not allowed: " + method); } Property p = getPropertyDef(method, method.getAnnotatedReturnType()); final Property[] array;