Skip to content

Improve error message for StreamReadConstraints violations #1007

@cowtowncoder

Description

@cowtowncoder

Currently (as of 2.15.0), violation of StreamReadConstraints is indicated by message like:

String length (50000001) exceeds the maximum length (5000000)

which does not much indication as to where the setting might be defined or changeable.
Let's add some more information; for example:

String value length (50000001) exceeds the maximum length (5000000 from `StreamReadConstraints.getMaxStringLength()`)

NOTE: not adding in 2.15.1 since Exception messages are part of API and while this seems generally useful I want to avoid potential breakage in patch release. But at the same time it's a minor change so do not think it requires waiting for major version (since timing of 3.0 is still unclear).

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.16Issue planned (at earliest) for 2.16

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions