Removed error log for null values

Original commit: elastic/x-pack-elasticsearch@4477fc1c2a
This commit is contained in:
Martijn van Groningen 2014-11-27 10:17:51 +01:00
parent 775f1cb878
commit 29dd1bb888
2 changed files with 4 additions and 6 deletions

View File

@ -195,7 +195,9 @@ public class AlertActionEntry implements ToXContent {
historyEntry.endObject();
historyEntry.field("request");
AlertUtils.writeSearchRequest(searchRequest, historyEntry, params);
historyEntry.field("response", searchResponse);
if (searchResponse != null) {
historyEntry.field("response", searchResponse);
}
historyEntry.startObject("actions");
for (AlertAction action : actions) {

View File

@ -240,11 +240,7 @@ public class AlertActionManager extends AbstractComponent {
throw new ElasticsearchIllegalArgumentException("Unexpected field [" + currentFieldName + "]");
}
} else {
if (token == XContentParser.Token.VALUE_NULL) {
logger.warn("Got null value for [{}]", currentFieldName);
} else {
throw new ElasticsearchIllegalArgumentException("Unexpected token [" + token + "] for [" + currentFieldName + "]");
}
throw new ElasticsearchIllegalArgumentException("Unexpected token [" + token + "] for [" + currentFieldName + "]");
}
}
} catch (IOException e) {