From 554973c890c5b794ba41422c5b73552ab8faf5f8 Mon Sep 17 00:00:00 2001 From: AvinashS Date: Wed, 20 Sep 2017 18:42:56 +0530 Subject: Exception handling for VNF validation Add initial customised exception handler class Change-Id: I319546d06579ee0dfbe164c09fc5fba89bcea652 IssueId: VNFSDK-46 Signed-off-by: AvinashS --- .../onap/validation/csar/ValidationException.java | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 csarvalidation/src/main/java/org/onap/validation/csar/ValidationException.java diff --git a/csarvalidation/src/main/java/org/onap/validation/csar/ValidationException.java b/csarvalidation/src/main/java/org/onap/validation/csar/ValidationException.java new file mode 100644 index 0000000..a587f32 --- /dev/null +++ b/csarvalidation/src/main/java/org/onap/validation/csar/ValidationException.java @@ -0,0 +1,45 @@ +/** + * Copyright 2017 Huawei Technologies Co., Ltd. + * + * 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. + */ +package org.onap.validation.csar; +class ValidationException extends Exception{ + + private String errCode = "Validation_Exception"; + private String errorMessage = "Error Message"; + public ValidationException(){ + super(); + } + + public ValidationException(String message){ + super(message); + } + + public ValidationException(String message, Throwable cause){ + super(message,cause); + } + + public ValidationException(String errCode, String message, Throwable cause){ + super(message,cause); + this.errCode = errCode; + } + + public String getErrCode() { + return this.errCode; + } + public String toString(){ + return ("Exception Number = "+errorMessage) ; + } + +} -- cgit 1.2.3-korg