modify TbRestApiCallNode

This commit is contained in:
ShvaykaD 2018-11-05 18:38:41 +02:00
parent ae91c85e1b
commit aa24461d30

View File

@ -118,7 +118,7 @@ public class TbRestApiCallNode implements TbNode {
}
private TbMsg processResponse(TbContext ctx, TbMsg origMsg, ResponseEntity<String> response) {
TbMsgMetaData metaData = new TbMsgMetaData();
TbMsgMetaData metaData = origMsg.getMetaData();
metaData.putValue(STATUS, response.getStatusCode().name());
metaData.putValue(STATUS_CODE, response.getStatusCode().value()+"");
metaData.putValue(STATUS_REASON, response.getStatusCode().getReasonPhrase());
@ -127,7 +127,7 @@ public class TbRestApiCallNode implements TbNode {
}
private TbMsg processFailureResponse(TbContext ctx, TbMsg origMsg, ResponseEntity<String> response) {
TbMsgMetaData metaData = origMsg.getMetaData().copy();
TbMsgMetaData metaData = origMsg.getMetaData();
metaData.putValue(STATUS, response.getStatusCode().name());
metaData.putValue(STATUS_CODE, response.getStatusCode().value()+"");
metaData.putValue(STATUS_REASON, response.getStatusCode().getReasonPhrase());
@ -136,7 +136,7 @@ public class TbRestApiCallNode implements TbNode {
}
private TbMsg processException(TbContext ctx, TbMsg origMsg, Throwable e) {
TbMsgMetaData metaData = origMsg.getMetaData().copy();
TbMsgMetaData metaData = origMsg.getMetaData();
metaData.putValue(ERROR, e.getClass() + ": " + e.getMessage());
if (e instanceof HttpClientErrorException) {
HttpClientErrorException httpClientErrorException = (HttpClientErrorException)e;