Bug 6244: Add context to exceptions thrown by yang statement parser
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / spi / meta / ReactorException.java
index 1ea15e28f30f77bbe8950a936626eb02816c90ad..9ab46d9f21c6edeee03a55974c4fa54b097480ca 100644 (file)
@@ -8,25 +8,32 @@
 package org.opendaylight.yangtools.yang.parser.spi.meta;
 
 import com.google.common.base.Preconditions;
+import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
 
 
 public class ReactorException extends Exception {
 
     private static final long serialVersionUID = 1L;
     private final ModelProcessingPhase phase;
+    private final SourceIdentifier sourceIdentifier;
 
-    public ReactorException(ModelProcessingPhase phase, String message, Throwable cause) {
+    public ReactorException(ModelProcessingPhase phase, String message, SourceIdentifier sourceId, Throwable cause) {
         super(message, cause);
         this.phase = Preconditions.checkNotNull(phase);
+        this.sourceIdentifier = sourceId;
     }
 
-    public ReactorException(ModelProcessingPhase phase, String message) {
+    public ReactorException(ModelProcessingPhase phase, String message, SourceIdentifier sourceId) {
         super(message);
         this.phase = Preconditions.checkNotNull(phase);
+        this.sourceIdentifier = sourceId;
     }
 
     public final ModelProcessingPhase getPhase() {
         return phase;
     }
 
+    public final SourceIdentifier getSourceIdentifier() {
+        return sourceIdentifier;
+    }
 }