aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2021-03-22 11:24:51 +0000
committerChristophe Closset <christophe.closset@intl.att.com>2021-03-24 15:47:38 +0000
commitc783eb50e01dbdbd478ec73ae9271da0cb49d9c2 (patch)
treec090b718ec1d3465df0863bc5c8eaed2960d1b13 /catalog-be
parent787cfd5756e784be88874ef31783584e0ffd5d0c (diff)
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 <andre.schmid@est.tech>
Diffstat (limited to 'catalog-be')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java7
1 files changed, 6 insertions, 1 deletions
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);