Skip to content

Commit

Permalink
DATACMNS-253 - Improved exception message in ParameterOutOfBoundsExce…
Browse files Browse the repository at this point in the history
…ption.
  • Loading branch information
odrotbohm committed Nov 27, 2012
1 parent c523abe commit fe8e484
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
@@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -165,7 +165,8 @@ public Parameter getParameter(int index) {
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);
}
}

Expand Down

0 comments on commit fe8e484

Please sign in to comment.