From c783eb50e01dbdbd478ec73ae9271da0cb49d9c2 Mon Sep 17 00:00:00 2001 From: "andre.schmid" Date: Mon, 22 Mar 2021 11:24:51 +0000 Subject: Handles ComponentException during Import VSP The ComponentException was being treated as a GENERAL_ERROR and loosing its message and HTTP status. Change-Id: Ia632ec53f10920a69a53eed3aedee773ef5e4d2f Issue-ID: SDC-3530 Signed-off-by: andre.schmid --- .../openecomp/sdc/be/components/impl/ResourceBusinessLogic.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'catalog-be/src/main/java/org') diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java index 22fdc3b6e5..fa58e61d3b 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java @@ -1488,7 +1488,12 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { "An error has occurred during resource and resource instance creation", e); rollback(inTransaction, resource, createdArtifacts, nodeTypesNewCreatedArtifacts); throw new ByResponseFormatComponentException(e.getResponseFormat()); - } catch (final Exception e) { + } catch (final ComponentException e) { + log.error(EcompLoggerErrorCode.SCHEMA_ERROR, ResourceBusinessLogic.class.getName(), + "An error has occurred during resource and resource instance creation", e); + rollback(inTransaction, resource, createdArtifacts, nodeTypesNewCreatedArtifacts); + throw new ByResponseFormatComponentException(e.getResponseFormat()); + } catch (final Exception e) { log.error(EcompLoggerErrorCode.BUSINESS_PROCESS_ERROR, ResourceBusinessLogic.class.getName(), "An error has occurred during resource and resource instance creation", e); rollback(inTransaction, resource, createdArtifacts, nodeTypesNewCreatedArtifacts); -- cgit 1.2.3-korg