Refactor InferenceAction
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / spi / meta / ReactorException.java
1 /*
2  * Copyright (c) 2015 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/epl-v10.html
7  */
8 package org.opendaylight.yangtools.yang.parser.spi.meta;
9
10 import com.google.common.base.Preconditions;
11 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
12
13 public class ReactorException extends Exception {
14     private static final long serialVersionUID = 1L;
15
16     private final ModelProcessingPhase phase;
17     private final SourceIdentifier sourceIdentifier;
18
19     public ReactorException(final ModelProcessingPhase phase, final String message, final SourceIdentifier sourceId,
20             final Throwable cause) {
21         super(message, cause);
22         this.phase = Preconditions.checkNotNull(phase);
23         this.sourceIdentifier = sourceId;
24     }
25
26     public ReactorException(final ModelProcessingPhase phase, final String message, final SourceIdentifier sourceId) {
27         super(message);
28         this.phase = Preconditions.checkNotNull(phase);
29         this.sourceIdentifier = sourceId;
30     }
31
32     public final ModelProcessingPhase getPhase() {
33         return phase;
34     }
35
36     public final SourceIdentifier getSourceIdentifier() {
37         return sourceIdentifier;
38     }
39 }