DATACMNS-253 - Improved exception message in ParameterOutOfBoundsException.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2010 the original author or authors.
|
||||
* Copyright 2008-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,10 +28,10 @@ public class ParameterOutOfBoundsException extends RuntimeException {
|
||||
/**
|
||||
* Creates a new {@link ParameterOutOfBoundsException} with the given exception as cause.
|
||||
*
|
||||
* @param message
|
||||
* @param cause
|
||||
*/
|
||||
public ParameterOutOfBoundsException(Throwable cause) {
|
||||
|
||||
super(cause);
|
||||
public ParameterOutOfBoundsException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2008-2011 the original author or authors.
|
||||
* Copyright 2008-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -165,7 +165,8 @@ public class Parameters implements Iterable<Parameter> {
|
||||
try {
|
||||
return parameters.get(index);
|
||||
} catch (IndexOutOfBoundsException e) {
|
||||
throw new ParameterOutOfBoundsException(e);
|
||||
throw new ParameterOutOfBoundsException(
|
||||
"Invalid parameter index! You seem to have declare too little query method parameters!", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user