Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeConverterSupport does not propagate custom exceptions anymore [SPR-14661] #19225

Closed
spring-projects-issues opened this issue Sep 2, 2016 · 3 comments

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Sep 2, 2016

Valentin Tsvetkov opened SPR-14661 and commented

catch (Throwable ex) on line 77 in TypeConverterSupport. In SpringBoot application we can't properly use @ControllerAdvice because our specific exception that we throw in converter catches in TypeConverterSupport and instead it throws TypeMismatchException.


Affects: 4.2.7

Issue Links:

  • #18917 Different error codes on same formatter registered in different ways
  • #19245 HibernateExceptionTranslator translating to InvalidDataAccessApiUsageException when using vanilla Hibernate

Referenced from: commits c69e6a3, 73bbe08, 883c3a6

Backported to: 4.2.8

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Sep 2, 2016

Juergen Hoeller commented

This seems to be a consequence of the fix in #18917 and therefore a regression. We'll revisit this for 4.2.8 / 4.3.3, possibly enumerating all actual type-mismatch-like exceptions there.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Sep 13, 2016

Juergen Hoeller commented

I've revised the fix for #18917 such that it only applies to Formatter.parse invocations, not to general conversion attempts. Specifically, TypeConverterSupport just catches IllegalArgumentException again but FormatterPropertyEditorAdapter turns any exception into an IllegalArgumentException if necessary now.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Sep 15, 2016

Juergen Hoeller commented

It would be great if you could give the latest 4.2.8.BUILD-SNAPSHOT or 4.3.3.BUILD-SNAPSHOT a try to check whether it works for you again...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants