Skip to content

Conversation

@original-brownbear
Copy link
Contributor

Exactly the same as #73268 but for metadata and index metadata which can run into
the same bug.

Exactly the same as elastic#73268 but for metadata and index metadata which can run into
the same bug.
@elasticmachine elasticmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Jul 1, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

if (parser.currentToken() != XContentParser.Token.FIELD_NAME) {
throw new IllegalArgumentException("expected field name but got a " + parser.currentToken());
}
XContentParserUtils.ensureExpectedToken(XContentParser.Token.FIELD_NAME, parser.currentToken(), parser);
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it's fine to throw here a ParsingException instead of IllegalArgumentException?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that's fine and maybe even preferable as it gives a much easier to interpret error message by including some bytes around the broken section in the message.

Copy link
Contributor

@fcofdez fcofdez left a comment

Choose a reason for hiding this comment

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

LGTM, I left a minor question. 👍

@original-brownbear
Copy link
Contributor Author

Thanks Francisco!

@original-brownbear original-brownbear merged commit 667f95b into elastic:master Jul 1, 2021
@original-brownbear original-brownbear deleted the fix-metadata-parsing branch July 1, 2021 18:06
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Jul 13, 2021
…lastic#74844)

Exactly the same as elastic#73268 but for metadata and index metadata which can run into
the same bug.
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Jul 13, 2021
…lastic#74844)

Exactly the same as elastic#73268 but for metadata and index metadata which can run into
the same bug.
original-brownbear added a commit that referenced this pull request Jul 13, 2021
…74844) (#75281)

Exactly the same as #73268 but for metadata and index metadata which can run into
the same bug.
original-brownbear added a commit that referenced this pull request Jul 13, 2021
…74844) (#75277)

Exactly the same as #73268 but for metadata and index metadata which can run into
the same bug.
@original-brownbear original-brownbear restored the fix-metadata-parsing branch April 18, 2023 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >non-issue Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. v7.14.0 v7.15.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants