diff options
Diffstat (limited to 'nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/util/CbamUtils.java')
-rw-r--r-- | nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/util/CbamUtils.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/util/CbamUtils.java b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/util/CbamUtils.java index 7377abfc..ebd4234a 100644 --- a/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/util/CbamUtils.java +++ b/nokiav2/driver/src/main/java/org/onap/vfc/nfvo/driver/vnfm/svnfm/nokia/util/CbamUtils.java @@ -20,8 +20,20 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import org.slf4j.Logger; +/** + * Collection of utility functions + */ public class CbamUtils { + private static class OperationMustBeAborted extends RuntimeException{ + OperationMustBeAborted(String msg){ + super(msg); + } + OperationMustBeAborted(Exception e, String msg){ + super(msg, e); + } + } + private CbamUtils() { //use static way } @@ -43,7 +55,7 @@ public class CbamUtils { public static JsonElement childElement(JsonObject parent, String name) { JsonElement child = parent.get(name); if (child == null) { - throw new RuntimeException("Missing child " + name); + throw new OperationMustBeAborted("Missing child " + name); } return child; } @@ -58,7 +70,7 @@ public class CbamUtils { */ public static RuntimeException fatalFailure(Logger logger, String msg, Exception e) { logger.error(msg, e); - throw new RuntimeException(msg, e); + throw new OperationMustBeAborted(e, msg); } /** @@ -70,6 +82,6 @@ public class CbamUtils { */ public static RuntimeException fatalFailure(Logger logger, String msg) { logger.error(msg); - throw new RuntimeException(msg); + throw new OperationMustBeAborted(msg); } } |