-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Benjamin M opened SPR-11500 and commented
The Converters documentation ( http://docs.spring.io/spring/docs/current/spring-framework-reference/html/validation.html ) says:
"Your Converter may throw any Exception if conversion fails. An IllegalArgumentException should be thrown to report an invalid source value."
BUT: I cannot use ANY Exception, the Exception to use must be a RuntimeException.
This doesn't work:
public class MyConverter implements Converter<A, B> {
@Override
public B convert(A a) {
throw new Exception();
}
}
Eclipse says: "Unhandled exception type Exception"
But this works:
public class MyConverter implements Converter<A, B> {
@Override
public B convert(A a) {
throw new RuntimeException();
}
}
Affects: 4.0.2
Referenced from: commits 035d9d5