Update yang-parser-api
[yangtools.git] / yang / yang-parser-api / src / main / java / org / opendaylight / yangtools / yang / parser / api / YangParserException.java
diff --git a/yang/yang-parser-api/src/main/java/org/opendaylight/yangtools/yang/parser/api/YangParserException.java b/yang/yang-parser-api/src/main/java/org/opendaylight/yangtools/yang/parser/api/YangParserException.java
new file mode 100644 (file)
index 0000000..709c372
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2017 Pantheon Technologies, s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.parser.api;
+
+import static java.util.Objects.requireNonNull;
+
+/**
+ * Base exception reported by {@link YangParser}. This is used as an exception of last resort, semantic reporting
+ * of individual errors is performed via subclasses, like {@link YangSyntaxErrorException}.
+ */
+public class YangParserException extends Exception {
+    private static final long serialVersionUID = 1L;
+
+    public YangParserException(final String message) {
+        super(requireNonNull(message));
+    }
+
+    public YangParserException(final String message, final Throwable cause) {
+        super(requireNonNull(message), cause);
+    }
+}