From 4690f792b80107f589de398f7718a9684509156a Mon Sep 17 00:00:00 2001 From: Oleksandr Moliavko Date: Wed, 11 Sep 2019 10:28:00 +0300 Subject: 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 Change-Id: I95765a1a5a10497e366b5d94b89d45b6bde2b212 --- .../tasks/ExecuteBuildingBlockRainyDay.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'bpmn/MSOCommonBPMN/src/main/java') 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; -- cgit 1.2.3-korg