Skip to content

Commit 7be87c9

Browse files
committed
only emit body element when actually timed out
1 parent 22ce589 commit 7be87c9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/src/main/java/org/elasticsearch/ElasticsearchException.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,9 @@ protected static void innerToXContent(
413413
// TODO: we could walk the exception chain to see if _any_ causes are timeouts?
414414
timedOut = exception.isTimeout();
415415
}
416-
builder.field(TIMED_OUT, timedOut);
416+
if (timedOut) {
417+
builder.field(TIMED_OUT, timedOut);
418+
}
417419

418420
for (Map.Entry<String, List<String>> entry : metadata.entrySet()) {
419421
headerToXContent(builder, entry.getKey().substring("es.".length()), entry.getValue());

0 commit comments

Comments
 (0)