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

DeserializationContext.instantiationException() throws InvalidDefinitionException #2126

Closed
cowtowncoder opened this issue Sep 5, 2018 · 0 comments
Milestone

Comments

@cowtowncoder
Copy link
Member

cowtowncoder commented Sep 5, 2018

As of Jackson 2.9, failures stemming from ValueInstantiator, most common of which is an exception from constructor, are reported as InvalidDefinitionExceptions. This is misleading as typically problem is not due to invalid POJO definition (as that would typically be reported much earlier during construction of deserializer), but due to processing problem possibly related to content being bound.

Since there is not enough information to know exact kind of failure, it seems prudent to create a new JsonMappingException sub-class, ValueInstantiationException.

Since this is a change to behavior, it can not go in a patch version. But I think it is reasonable to add it in minor release (2.10), given that exact subtype has been only used since 2.9.

@cowtowncoder cowtowncoder added this to the 2.10.0 milestone Sep 5, 2018
finaglehelper pushed a commit to twitter/finatra that referenced this issue Dec 3, 2019
…eption

Problem/Solution

Update `c.t.finatra.json.internal.caseclass.utils.FieldInjection`
to also catch `ValueInstantiationException` due to
FasterXML/jackson-databind#2126.

Differential Revision: https://phabricator.twitter.biz/D407296
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant