Have ConversionFailedException store/expose the failed value [SPR-6629] #11295
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
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
The text was updated successfully, but these errors were encountered: