Include argument name in MethodArgumentTypeMismatchException message

Closes gh-33573
This commit is contained in:
Simon Baslé
2024-10-03 16:27:01 +02:00
parent 0b3b1391c1
commit b54420f8aa
2 changed files with 40 additions and 1 deletions

View File

@@ -45,7 +45,6 @@ public class MethodArgumentTypeMismatchException extends TypeMismatchException {
initPropertyName(name);
}
/**
* Return the name of the method argument.
*/
@@ -60,4 +59,9 @@ public class MethodArgumentTypeMismatchException extends TypeMismatchException {
return this.parameter;
}
@Override
public String getMessage() {
return "Method parameter '" + getName() + "': " + super.getMessage();
}
}