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 / repo / SharedSchemaContextFactory.java
index 7b40342003c575eca5692f0f88d4ca6ad827a441..fb83f5db5a6231ff57383c938e3487ac1777d5f2 100644 (file)
@@ -219,7 +219,12 @@ final class SharedSchemaContextFactory implements SchemaContextFactory {
                 reactor.addSource(new YangStatementSourceImpl(e.getKey(), (StatementContext) parserRuleCtx));
             }
 
-            final SchemaContext schemaContext = reactor.buildEffective();
+            final SchemaContext schemaContext;
+            try {
+                schemaContext = reactor.buildEffective();
+            } catch (ReactorException ex) {
+                throw new SchemaResolutionException("Failed to resolve required models", ex.getSourceIdentifier(), ex);
+            }
 
             return Futures.immediateCheckedFuture(schemaContext);
         }