Skip to content

Commit eac7125

Browse files
committed
Add public constructor that accepts a cause
Add a public constructor to `InvalidConfigurationPropertyValueException` that accepts a cause. Closes gh-50211
1 parent c420d8e commit eac7125

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

core/spring-boot/src/main/java/org/springframework/boot/context/properties/source/InvalidConfigurationPropertyValueException.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,18 @@ public InvalidConfigurationPropertyValueException(String name, @Nullable Object
4848
this(name, value, reason, null);
4949
}
5050

51-
InvalidConfigurationPropertyValueException(String name, @Nullable Object value, @Nullable String reason,
51+
/**
52+
* Creates a new instance for the specified property {@code name} and {@code value},
53+
* including a {@code reason} why the value is invalid.
54+
* @param name the name of the property in canonical format
55+
* @param value the value of the property, can be {@code null}
56+
* @param reason a human-readable text that describes why the reason is invalid.
57+
* Starts with an upper-case and ends with a dot. Several sentences and carriage
58+
* returns are allowed.
59+
* @param cause the cause of the exception or {@code null}
60+
* @since 4.1.0
61+
*/
62+
public InvalidConfigurationPropertyValueException(String name, @Nullable Object value, @Nullable String reason,
5263
@Nullable Throwable cause) {
5364
super("Property " + name + " with value '" + value + "' is invalid: " + reason, cause);
5465
Assert.notNull(name, "'name' must not be null");

0 commit comments

Comments
 (0)