DATACMNS-253 - Improved exception message in ParameterOutOfBoundsException.

This commit is contained in:
Oliver Gierke
2012-11-27 13:39:36 +01:00
parent c523abe6c8
commit fe8e48455e
2 changed files with 7 additions and 6 deletions

View File

@@ -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);
}
}

View File

@@ -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);
}
}