Skip to content

DeserializationContext.instantiationException() throws InvalidDefinitionException #2126

@cowtowncoder

Description

@cowtowncoder

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions