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

Issue #86 - Adding request body to the JsonParseException on demand #258

Closed
wants to merge 1 commit into from

Conversation

LokeshN
Copy link
Contributor

@LokeshN LokeshN commented Mar 15, 2016

This commit adds the request body(issue #86 ) to the JsonParseException on demand.
By setting the property addRequestBodyOnError in JsonParser, the request body is added to JsonParseException.
The request body is added as a separate property to the JsonParseException which can be retrieved using JsonParseException.getRequestBody()

By default the request body will not be added to the JsonParseException as the flag is turned off, it can be turned on by using JsonParser.addRequestBodyOnError(true);

@LokeshN LokeshN changed the title Issue86 - Adding request body to the JsonParseException on demand Issue#86 - Adding request body to the JsonParseException on demand Mar 15, 2016
@LokeshN LokeshN changed the title Issue#86 - Adding request body to the JsonParseException on demand Issue #86 - Adding request body to the JsonParseException on demand Mar 15, 2016
@cowtowncoder
Copy link
Member

While I appreciate your suggestion for solution, I don't think I will accept it. Most InputStreams and Readers are not rewindable and so most of the contents would not be available to be included in exception. There are other potential issues (max length of contents to read should probably be bounded), but that is the main one.

@LokeshN
Copy link
Contributor Author

LokeshN commented Mar 17, 2016

I have created another pull request with a different solution.
Closing this for now.

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

Successfully merging this pull request may close these issues.

None yet

2 participants