-
Notifications
You must be signed in to change notification settings - Fork 25k
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
JSON parse failures should be 4xx codes #112703
JSON parse failures should be 4xx codes #112703
Conversation
Pinging @elastic/es-search (Team:Search) |
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Hi @benwtrent, I've created a changelog YAML for you. |
…h into json-failures-4xx
…h into json-failures-4xx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed with @cbuescher whether IllegalArgumentException was a good choice on #112605. I'm fine with either IllegalArgumentException or ValidationException, but I think that whatever we choose it's better to be consistent. Wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I have one suggestion to make the error message easier to understand
...-content/impl/src/main/java/org/elasticsearch/xcontent/provider/json/JsonXContentParser.java
Outdated
Show resolved
Hide resolved
@ldematte @cbuescher I read the discussion, IAE or an xcontent parsing exception makes sense to me here as we are parsing values input values. The PR linked has to do with the content type not even being known. That to me is a horse of a different color. While, so, I would prefer an IAE there as well as the input is the REST request we are handling and thus an illegal argument was given, the poorly formed request. |
@elasticmachine update branch |
Hi @benwtrent, I've updated the changelog YAML for you. |
It seemed if there wasn't any text to parse, this is not an internal issue but instead an argument issue. I simply changed the exception thrown. If we don't agree with this, I can adjust `query` parsing directly, but this seemed like the better choice. closes: elastic#112296
💚 Backport successful
|
It seemed if there wasn't any text to parse, this is not an internal issue but instead an argument issue. I simply changed the exception thrown. If we don't agree with this, I can adjust `query` parsing directly, but this seemed like the better choice. closes: #112296 Co-authored-by: Elastic Machine <[email protected]>
It seemed if there wasn't any text to parse, this is not an internal issue but instead an argument issue. I simply changed the exception thrown. If we don't agree with this, I can adjust `query` parsing directly, but this seemed like the better choice. closes: #112296
It seemed if there wasn't any text to parse, this is not an internal issue but instead an argument issue.
I simply changed the exception thrown. If we don't agree with this, I can adjust
query
parsing directly, but this seemed like the better choice.closes: #112296