aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks/src/main/java
diff options
context:
space:
mode:
authorSteve Smokowski <ss835w@att.com>2019-06-27 18:23:48 +0000
committerGerrit Code Review <gerrit@onap.org>2019-06-27 18:23:48 +0000
commit8e42b4e3fd9c00d73d371ccdbe2147733821bb56 (patch)
treefe4f23c6a068b268b8883dda067a9040537c6d6e /bpmn/so-bpmn-tasks/src/main/java
parent205f358c6e06726de738b0c7706ec1c3c94afeaa (diff)
parent757a0ca529716eed2882c1227df5270a1c24bbaf (diff)
Merge "improved logging when no exception data is found"
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main/java')
-rw-r--r--bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java
index 35ceef0473..4d2f9fd98c 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java
@@ -125,7 +125,7 @@ public class WorkflowActionBBFailure {
}
private Optional<String> retrieveErrorMessage(DelegateExecution execution) {
- String errorMsg = "";
+ String errorMsg = null;
try {
WorkflowException exception = (WorkflowException) execution.getVariable("WorkflowException");
if (exception != null && (exception.getErrorMessage() != null || !exception.getErrorMessage().equals(""))) {
@@ -134,6 +134,10 @@ public class WorkflowActionBBFailure {
if (errorMsg == null || errorMsg.equals("")) {
errorMsg = (String) execution.getVariable("WorkflowExceptionErrorMessage");
}
+ if (errorMsg == null) {
+ throw new IllegalStateException(
+ "could not find WorkflowException or WorkflowExceptionErrorMessage in execution");
+ }
return Optional.of(errorMsg);
} catch (Exception ex) {
logger.error("Failed to extract workflow exception from execution.", ex);