aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-tasks
diff options
context:
space:
mode:
authorBenjamin, Max <max.benjamin@att.com>2019-06-26 11:35:00 -0400
committerMax Benjamin <max.benjamin@att.com>2019-06-27 16:09:34 +0000
commit757a0ca529716eed2882c1227df5270a1c24bbaf (patch)
treea78351a03bfaba8e1bc7da105d8d1f37cf4c736d /bpmn/so-bpmn-tasks
parent5c58eeca5ffd8b080b9af7619a903eb0acff3a0d (diff)
improved logging when no exception data is found
improved logging when no exception data is found Change-Id: I4f6298652ad474119cd1ebc58a927d532ea3e6be Issue-ID: SO-2068 Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'bpmn/so-bpmn-tasks')
-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);