Skip to content

Commit 203ca30

Browse files
committed
Include cause in MethodInvocationException message
Closes gh-34691
1 parent 34ea046 commit 203ca30

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spring-beans/src/main/java/org/springframework/beans/MethodInvocationException.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
2525
* analogous to an InvocationTargetException.
2626
*
2727
* @author Rod Johnson
28+
* @author Juergen Hoeller
2829
*/
2930
@SuppressWarnings("serial")
3031
public class MethodInvocationException extends PropertyAccessException {
@@ -41,7 +42,9 @@ public class MethodInvocationException extends PropertyAccessException {
4142
* @param cause the Throwable raised by the invoked method
4243
*/
4344
public MethodInvocationException(PropertyChangeEvent propertyChangeEvent, @Nullable Throwable cause) {
44-
super(propertyChangeEvent, "Property '" + propertyChangeEvent.getPropertyName() + "' threw exception", cause);
45+
super(propertyChangeEvent,
46+
"Property '" + propertyChangeEvent.getPropertyName() + "' threw exception: " + cause,
47+
cause);
4548
}
4649

4750
@Override

0 commit comments

Comments
 (0)