diff options
author | 2019-05-22 16:41:09 +0200 | |
---|---|---|
committer | 2019-06-10 07:19:18 +0000 | |
commit | 91a31137b44d034823f72b190fc42539993c6593 (patch) | |
tree | 10e12209ec28691d51e85d4c01cd337cc3264bcd /catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/utils | |
parent | 1e744a3293de1598d119c35a5efeb71c97c40159 (diff) |
Inheritance in ComponentException
ComponentException was split into ByActionStatus and ByResponseFormat exceptions.
Test added for ComponentLockAspectTest in passing
Change-Id: I89c9ee966b8b4445e791af897bd60cdb845b845b
Issue-ID: SDC-2321
Signed-off-by: Tomasz Golabek <tomasz.golabek@nokia.com>
Diffstat (limited to 'catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/utils')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/utils/ExceptionUtils.java | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/utils/ExceptionUtils.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/utils/ExceptionUtils.java index e48d21cb77..2d6f354139 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/utils/ExceptionUtils.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/utils/ExceptionUtils.java @@ -1,6 +1,28 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + * Modifications copyright (c) 2019 Nokia + * ================================================================================ + */ package org.openecomp.sdc.be.components.impl.utils; -import org.openecomp.sdc.be.components.impl.exceptions.ComponentException; +import org.openecomp.sdc.be.components.impl.exceptions.ByActionStatusComponentException; +import org.openecomp.sdc.be.components.impl.exceptions.ByResponseFormatComponentException; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.dao.jsongraph.TitanDao; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; @@ -20,12 +42,12 @@ public class ExceptionUtils { public <T> T rollBackAndThrow(ActionStatus actionStatus, String ... params) { titanDao.rollback(); - throw new ComponentException(actionStatus, params); + throw new ByActionStatusComponentException(actionStatus, params); } public <T> T rollBackAndThrow(ResponseFormat responseFormat) { titanDao.rollback(); - throw new ComponentException(responseFormat); + throw new ByResponseFormatComponentException(responseFormat); } public <T> T rollBackAndThrow(StorageOperationStatus status, String ... params) { |