@@ -53,16 +53,16 @@ public QueryMethod(Method method, RepositoryMetadata metadata) {
53
53
54
54
for (Class <?> type : Parameters .TYPES ) {
55
55
if (getNumberOfOccurences (method , type ) > 1 ) {
56
- throw new IllegalStateException (
57
- String . format ( "Method must only one argument of type %s!" , type . getSimpleName ()));
56
+ throw new IllegalStateException (String . format ( "Method must only one argument of type %s! Offending method: %s" ,
57
+ type . getSimpleName (), method . toString ()));
58
58
}
59
59
}
60
60
61
61
if (hasParameterOfType (method , Pageable .class )) {
62
62
assertReturnTypeAssignable (method , Page .class , List .class );
63
63
if (hasParameterOfType (method , Sort .class )) {
64
- throw new IllegalStateException ("Method must not have Pageable *and* Sort parameter. "
65
- + "Use sorting capabilities on Pageble instead!" );
64
+ throw new IllegalStateException (String . format ( "Method must not have Pageable *and* Sort parameter. "
65
+ + "Use sorting capabilities on Pageble instead! Offending method: %s" , method . toString ()) );
66
66
}
67
67
}
68
68
@@ -73,7 +73,8 @@ public QueryMethod(Method method, RepositoryMetadata metadata) {
73
73
Assert .notNull (this .parameters );
74
74
75
75
if (isPageQuery ()) {
76
- Assert .isTrue (this .parameters .hasPageableParameter (), "Paging query needs to have a Pageable parameter!" );
76
+ Assert .isTrue (this .parameters .hasPageableParameter (),
77
+ String .format ("Paging query needs to have a Pageable parameter! Offending method %s" , method .toString ()));
77
78
}
78
79
}
79
80
0 commit comments