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

Unwrap JsonMappingException if cause is LengthLimitingJsonProcessingException #1082

Merged
merged 2 commits into from
Jun 16, 2023

Conversation

jasmith-hs
Copy link
Contributor

As a follow up to #1051, since these exceptions are now wrapped in JsonMappingException, we can unwrap them to see if they are caused by LengthLimitingJsonProcessingException so that we'll convert it to an OutputTooBigException

Copy link
Contributor

@boulter boulter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you

Comment on lines +47 to +49
if (JinjavaInterpreter.isOutputTooLarge(output)) {
return wrapEagerInterpret(tagNode, interpreter, null);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only want to do the deferred execution eager interpret if we fully succeeded, but the output is too large. If we encountered an uncaught OutputTooBigException while running innerInterpret, we haven't handled that, and the context won't be in a proper state. (It likely would come from attempting to reconstruct a value, but its string representation is too large.)

@jasmith-hs jasmith-hs merged commit a573690 into master Jun 16, 2023
@jasmith-hs jasmith-hs deleted the unwrap-json-mapping-exception branch June 16, 2023 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants