close
Skip to content

Unwrap JsonMappingException if cause is LengthLimitingJsonProcessingException#1082

Merged
jasmith-hs merged 2 commits intomasterfrom
unwrap-json-mapping-exception
Jun 16, 2023
Merged

Unwrap JsonMappingException if cause is LengthLimitingJsonProcessingException#1082
jasmith-hs merged 2 commits intomasterfrom
unwrap-json-mapping-exception

Conversation

@jasmith-hs
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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