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

Have ConversionFailedException store/expose the failed value [SPR-6629] #11295

Closed
spring-projects-issues opened this issue Dec 30, 2009 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Chris Hubick opened SPR-6629 and commented

The org.springframework.core.convert.ConversionFailedException constructor currently accepts an "Object value - the value we tried to convert" argument, which it uses while constructing the exception detail message, but it doesn't store this value, nor provide a getValue() accessor method.

For client code dealing with the conversion of more complex custom classes, the ability to catch a ConversionFailedException and gain a reference to the failed value would enable that code to use it to provide much better logging/error/debugging context information than a simple toString() of the failed value will currently provide.

Thanks for you consideration.


Affects: 3.0 GA

Attachments:

Referenced from: commits 4a90266

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Good point! I've added a "getValue()" method that exposes the actual value object.

Juergen

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0.1 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants