Creating the actionExecutionResult object for error scenarios as well.

This ensures that we can populate the request fields for all action executions
This commit is contained in:
Arpit Mohan 2020-05-23 12:49:01 +05:30
parent 14c1778645
commit e6b7ffca9c

View File

@ -427,6 +427,13 @@ public class ActionServiceImpl extends BaseService<ActionRepository, Action, Str
datasourceConfiguration,
actionConfiguration))
.timeout(Duration.ofMillis(timeoutDuration))
.onErrorResume(e -> {
log.debug("In the action execution error mode. Cause: {}", e.getMessage());
ActionExecutionResult result = new ActionExecutionResult();
result.setBody(e.getMessage());
result.setIsExecutionSuccess(false);
return Mono.just(result);
})
.map(obj -> populateRequestFields(actionConfiguration, (ActionExecutionResult) obj));
}))
.flatMap(obj -> obj);