2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
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/epl-v10.html
8 package org.opendaylight.yangtools.yang.parser.spi.source;
10 import com.google.common.base.Preconditions;
11 import javax.annotation.Nonnull;
15 * Thrown to indicate error in YANG model source.
18 public class SourceException extends RuntimeException {
23 private static final long serialVersionUID = 1L;
25 private final StatementSourceReference sourceRef;
27 public SourceException(@Nonnull String message,@Nonnull StatementSourceReference source) {
28 super(Preconditions.checkNotNull(message));
29 sourceRef = Preconditions.checkNotNull(source);
32 public SourceException(@Nonnull String message,@Nonnull StatementSourceReference source, Throwable cause) {
33 super(Preconditions.checkNotNull(message),cause);
34 sourceRef = Preconditions.checkNotNull(source);
37 public @Nonnull StatementSourceReference getSourceReference() {