aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleksandr Moliavko <o.moliavko@samsung.com>2019-09-11 10:28:00 +0300
committerOleksandr Moliavko <o.moliavko@samsung.com>2019-09-11 16:37:10 +0300
commit4690f792b80107f589de398f7718a9684509156a (patch)
tree89772f9239c4ca3ffdcc1a7383a022486299fa16
parent0966d538f7f04dbb99e5028e09057a3e8f866cab (diff)
Added null check to avoid crash at
getErrorCode() call; fixed typos in error messages; removed unnecessary try...catch block Issue-ID: SO-1841 Signed-off-by: Oleksandr Moliavko<o.moliavko@samsung.com> Change-Id: I95765a1a5a10497e366b5d94b89d45b6bde2b212
-rw-r--r--bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java
index be53e505ac..9a9e914c85 100644
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java
+++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java
@@ -104,7 +104,7 @@ public class ExecuteBuildingBlockRainyDay {
}
} catch (Exception ex) {
// keep default serviceType value
- logger.error("Exception in serviceType retrivel", ex);
+ logger.error("Exception in serviceType retrieval", ex);
}
String vnfType = ASTERISK;
try {
@@ -116,22 +116,21 @@ public class ExecuteBuildingBlockRainyDay {
}
} catch (Exception ex) {
// keep default vnfType value
- logger.error("Exception in vnfType retrivel", ex);
+ logger.error("Exception in vnfType retrieval", ex);
}
String errorCode = ASTERISK;
- try {
+ if (workflowException != null) {
errorCode = "" + workflowException.getErrorCode();
- } catch (Exception ex) {
- // keep default errorCode value
- logger.error("Exception in errorCode retrivel", ex);
+ } else {
+ logger.debug("WorkflowException is null, unable to get error code");
}
try {
errorCode = "" + (String) execution.getVariable("WorkflowExceptionCode");
} catch (Exception ex) {
// keep default errorCode value
- logger.error("Exception in errorCode retrivel", ex);
+ logger.error("Exception in errorCode retrieval", ex);
}
String workStep = ASTERISK;
@@ -139,7 +138,7 @@ public class ExecuteBuildingBlockRainyDay {
workStep = workflowException.getWorkStep();
} catch (Exception ex) {
// keep default workStep value
- logger.error("Exception in workStep retrivel", ex);
+ logger.error("Exception in workStep retrieval", ex);
}
String errorMessage = ASTERISK;
@@ -147,7 +146,7 @@ public class ExecuteBuildingBlockRainyDay {
errorMessage = workflowException.getErrorMessage();
} catch (Exception ex) {
// keep default workStep value
- logger.error("Exception in errorMessage retrivel", ex);
+ logger.error("Exception in errorMessage retrieval", ex);
}
String serviceRole = ASTERISK;