diff options
author | andre.schmid <andre.schmid@est.tech> | 2021-02-19 16:52:51 +0000 |
---|---|---|
committer | Christophe Closset <christophe.closset@intl.att.com> | 2021-02-25 13:27:05 +0000 |
commit | 5c50d66c0ddcc3de44ed897151ea8431550af07b (patch) | |
tree | e3dd646504503a1175c8d525843c83157d46b5a4 | |
parent | cb44534e601539dbe1b882da257f9defad57f5f3 (diff) |
Fix rollback during resource creation
Change-Id: If4014483da98857895ebd9528c82fd337aa5ddf8
Issue-ID: SDC-3474
Signed-off-by: andre.schmid <andre.schmid@est.tech>
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java | 18 |
1 files changed, 7 insertions, 11 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 8cfd8c7007..3676844516 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 @@ -149,7 +149,6 @@ import org.openecomp.sdc.be.model.category.CategoryDefinition; import org.openecomp.sdc.be.model.category.SubCategoryDefinition; import org.openecomp.sdc.be.model.jsonjanusgraph.operations.ArtifactsOperations; import org.openecomp.sdc.be.model.jsonjanusgraph.operations.InterfaceOperation; -import org.openecomp.sdc.be.model.jsonjanusgraph.operations.exception.ToscaOperationException; import org.openecomp.sdc.be.model.jsonjanusgraph.utils.ModelConverter; import org.openecomp.sdc.be.model.operations.StorageException; import org.openecomp.sdc.be.model.operations.api.ICapabilityTypeOperation; @@ -1745,19 +1744,16 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { ASDCKpiApi.countCreatedResourcesKPI(); return resource; - } catch (final ComponentException | StorageException e) { - rollback(inTransaction, resource, createdArtifacts, nodeTypesNewCreatedArtifacts); - throw e; - } catch (final ToscaOperationException e) { - log.error("An error has occurred during resource and resource instance creation", e); - rollback(inTransaction, resource, createdArtifacts, nodeTypesNewCreatedArtifacts); - log.error(EcompLoggerErrorCode.BUSINESS_PROCESS_ERROR, ResourceBusinessLogic.class.getName(), - "catalog-be", e.getMessage()); - throw new ByActionStatusComponentException(ActionStatus.GENERAL_ERROR); } catch (final BusinessLogicException e) { - log.error("An error has occurred during resource and resource instance creation", 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); 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); + throw new ByActionStatusComponentException(ActionStatus.GENERAL_ERROR); } finally { if (!inTransaction) { janusGraphDao.commit(); |