diff options
Diffstat (limited to 'vid-app-common/src/main/java/org')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementServiceImpl.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementServiceImpl.java index 814959020..214eec79d 100644 --- a/vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementServiceImpl.java +++ b/vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementServiceImpl.java @@ -162,13 +162,19 @@ public class ChangeManagementServiceImpl implements ChangeManagementService { protected String extractServiceInstanceId(RequestDetails currentRequestDetails, String requestType) { - String serviceInstanceId = currentRequestDetails.getRelatedInstList().get(0) - .getRelatedInstance().getInstanceId(); - if (serviceInstanceId == null) { + try { + String serviceInstanceId = currentRequestDetails.getRelatedInstList().get(0) + .getRelatedInstance().getInstanceId(); + if (serviceInstanceId == null) { + logger.error("Failed to extract serviceInstanceId"); + throw new BadRequestException("No instanceId in request " + requestType); + } + return serviceInstanceId; + } + catch (Exception e) { logger.error("Failed to extract serviceInstanceId"); throw new BadRequestException("No instanceId in request " + requestType); } - return serviceInstanceId; } @Override |