@@ -508,13 +508,12 @@ public static ElasticsearchException fromXContent(XContentParser parser) throws
508
508
ElasticsearchException e = new ElasticsearchException (message .toString (), cause );
509
509
510
510
for (Map .Entry <String , List <String >> entry : metadata .entrySet ()) {
511
- //TODO subclasses can print out additional metadata through metadataToXContent. Complex objects are not currently supported,
512
- //while key-value pairs are. Those become part of the metadata set and inherit the "es." prefix as that is currently required
513
- //by addMetadata. The prefix will get stripped out anyways when printing metadata out so it will be invisible.
514
- //The only potential problem would manifest if a parsed exception is serialized back to a version < 5.3.0 , then the additional
515
- //metadata would be sent back as es. response headers which is surprising. That said this never ever happens as exceptions
516
- //are only parsed in the high level REST client. Maybe this is a good reason to have parsing code for exceptions in the client
517
- //only, also because while response may moved out of core one day, exception most likely won't.
511
+ //subclasses can print out additional metadata through the metadataToXContent method. Simple key-value pairs will be
512
+ //parsed back and become part of this metadata set, while objects and arrays are not supported when parsing back.
513
+ //Those key-value pairs become part of the metadata set and inherit the "es." prefix as that is currently required
514
+ //by addMetadata. The prefix will get stripped out when printing metadata out so it will be effectively invisible.
515
+ //TODO move subclasses that print out simple metadata to using addMetadata directly and support also numbers and booleans.
516
+ //TODO rename metadataToXContent and have only SearchPhaseExecutionException use it, which prints out complex objects
518
517
e .addMetadata ("es." + entry .getKey (), entry .getValue ());
519
518
}
520
519
for (Map .Entry <String , Object > header : headers .entrySet ()) {
0 commit comments