From fbf6300274558ffe323bf66bb5b23c72c350d3ee Mon Sep 17 00:00:00 2001 From: MichaelMorris Date: Thu, 3 Oct 2019 17:45:05 +0100 Subject: Improved error handling Change-Id: Iac436f6a950bf61ac6321ef1d427a7bb14774e30 Issue-ID: SO-2395 Signed-off-by: MichaelMorris --- .../adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'bpmn/so-bpmn-tasks/src/main/java/org') diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java index 32516c1dcb..41649dc838 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnfm/tasks/VnfmAdapterServiceProviderImpl.java @@ -20,7 +20,9 @@ package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks; +import com.google.common.base.Optional; import org.onap.so.rest.exceptions.InvalidRestRequestException; +import org.onap.so.rest.exceptions.HttpResouceNotFoundException; import org.onap.so.rest.exceptions.RestProcessingException; import org.onap.so.rest.service.HttpRestServiceProvider; import org.onap.vnfmadapter.v1.model.CreateVnfRequest; @@ -33,7 +35,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; -import com.google.common.base.Optional; /** * @author waqas.ikram@est.tech @@ -82,7 +83,8 @@ public class VnfmAdapterServiceProviderImpl implements VnfmAdapterServiceProvide } return Optional.of(createVnfResponse); - } catch (final RestProcessingException | InvalidRestRequestException httpInvocationException) { + } catch (final RestProcessingException | InvalidRestRequestException + | HttpResouceNotFoundException httpInvocationException) { LOGGER.error("Unexpected error while processing create and instantiation request", httpInvocationException); return Optional.absent(); } @@ -144,7 +146,8 @@ public class VnfmAdapterServiceProviderImpl implements VnfmAdapterServiceProvide return Optional.absent(); } return Optional.of(response.getBody()); - } catch (final RestProcessingException | InvalidRestRequestException httpInvocationException) { + } catch (final RestProcessingException | InvalidRestRequestException + | HttpResouceNotFoundException httpInvocationException) { LOGGER.error("Unexpected error while processing job request", httpInvocationException); throw httpInvocationException; } -- cgit 1.2.3-korg