loosened constructor arg to Throwable
I see no value in InvocationTargetException catching--method invoker now does unwrap of target exception. Please review.
This commit is contained in:
@@ -44,7 +44,7 @@ public class MethodInvocationException extends NestedRuntimeException {
|
||||
* @param arguments the arguments
|
||||
* @param cause the root cause
|
||||
*/
|
||||
public MethodInvocationException(MethodSignature methodSignature, Object[] arguments, Exception cause) {
|
||||
public MethodInvocationException(MethodSignature methodSignature, Object[] arguments, Throwable cause) {
|
||||
super("Unable to invoke method " + methodSignature + " with arguments " + StylerUtils.style(arguments), cause);
|
||||
this.methodSignature = methodSignature;
|
||||
this.arguments = arguments;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package org.springframework.binding.method;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
@@ -99,6 +100,9 @@ public class MethodInvoker {
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
catch (InvocationTargetException e) {
|
||||
throw new MethodInvocationException(signature, arguments, e.getTargetException());
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new MethodInvocationException(signature, arguments, e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user