blob: cf2c07dbb3944c17deeac12710e8ae391d6df73f [file] [log] [blame]
b.janani1fef2732016-03-04 12:29:05 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
b.janani1fef2732016-03-04 12:29:05 +05303 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.yangutils.translator.exception;
18
19/**
Bharat saraswald9822e92016-04-05 15:13:44 +053020 * Represents custom translator exception for translator's operations.
b.janani1fef2732016-03-04 12:29:05 +053021 */
22public class TranslatorException extends RuntimeException {
23
24 private static final long serialVersionUID = 20160311L;
25 private String fileName;
26
27 /**
28 * Create a new translator exception.
29 */
30 public TranslatorException() {
31 super();
32 }
33
34 /**
35 * Creates a new translator exception with given message.
36 *
37 * @param message the detail of exception in string
38 */
39 public TranslatorException(String message) {
40 super(message);
41 }
42
43 /**
44 * Creates a new translator exception from given message and cause.
45 *
46 * @param message the detail of exception in string
47 * @param cause underlying cause of the error
48 */
49 public TranslatorException(final String message, final Throwable cause) {
50 super(message, cause);
51 }
52
53 /**
54 * Creates a new translator exception from cause.
55 *
56 * @param cause underlying cause of the error
57 */
58 public TranslatorException(final Throwable cause) {
59 super(cause);
60 }
61
62 /**
63 * Returns generated file name for the exception.
64 *
65 * @return generated file name for the exception
66 */
67 public String getFileName() {
68 return this.fileName;
69 }
70
71 /**
72 * Sets file name in translator exception.
73 *
74 * @param fileName generated file name
75 */
76 public void setFileName(String fileName) {
77 this.fileName = fileName;
78 }
79}