Add more context when failing to construct a MethodTarget

This commit is contained in:
Eric Bottard
2017-08-09 15:48:49 +02:00
parent 4ff91f3583
commit 7efb3cd049

View File

@@ -39,7 +39,7 @@ public class MethodTarget {
public MethodTarget(Method method, Object bean, String help) {
Assert.notNull(method, "Method cannot be null");
Assert.notNull(bean, "Bean cannot be null");
Assert.hasText(help, "Help cannot be blank");
Assert.hasText(help, String.format("Help cannot be blank when trying to define command based on '%s'", method));
ReflectionUtils.makeAccessible(method);
this.method = method;
this.bean = bean;