Skip to content

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

@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions