Skip to content

Commit aeddd83

Browse files
committed
ServiceHelper: include class name with field
This is helpful in knowing exactly where the culprit is, in case of failed context creation.
1 parent f0529cc commit aeddd83

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/scijava/service/ServiceHelper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ private <S extends Service> S createServiceRecursively(final Class<S> c)
273273
continue;
274274
}
275275
if (!Service.class.isAssignableFrom(type)) {
276-
throw new IllegalArgumentException("Invalid parameter: " + f.getName());
276+
throw new IllegalArgumentException("Invalid parameter: " +
277+
f.getDeclaringClass().getName() + "#" + f.getName());
277278
}
278279
@SuppressWarnings("unchecked")
279280
final Class<? extends Service> serviceType =

0 commit comments

Comments
 (0)