301e5332f8d7cc38b1066c4998d9d0135488d02a
[controller.git] / opendaylight / sal / yang-prototype / code-generator / yang-model-parser-impl / src / main / java / org / opendaylight / controller / yang / model / parser / util / YangParseException.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/eplv10.html
7  */
8 package org.opendaylight.controller.yang.model.parser.util;
9
10 public class YangParseException extends RuntimeException {
11
12     private static final long serialVersionUID = 1239548963471793178L;
13
14     public YangParseException(final String errorMsg) {
15         super(errorMsg);
16     }
17
18     public YangParseException(final String errorMsg, final Exception exception) {
19         super(errorMsg, exception);
20     }
21
22     public YangParseException(final int line, final String errorMsg) {
23         super("Error on line " + line + ": " + errorMsg);
24     }
25
26     public YangParseException(final int line, final String errorMsg,
27             final Exception exception) {
28         super("Error on line " + line + ": " + errorMsg, exception);
29     }
30
31     public YangParseException(final String moduleName, final int line,
32             final String errorMsg) {
33         super("Error in module '" + moduleName + "' on line " + line + ": "
34                 + errorMsg);
35     }
36
37     public YangParseException(final String moduleName, final int line,
38             final String errorMsg, final Exception exception) {
39         super("Error in module '" + moduleName + "' on line " + line + ": "
40                 + errorMsg, exception);
41     }
42
43 }