- File file = new File("src/main/yang/entity-owners.yang");
- return parser.parseSources(Arrays.asList(Resources.asByteSource(file.toURI().toURL())));
- } catch (IOException | YangSyntaxErrorException e) {
- throw new ExceptionInInitializerError(e);
+ file = new File("src/main/yang/entity-owners.yang");
+ final List<ByteSource> sources = Arrays.asList(Resources.asByteSource(file.toURI().toURL()));
+ try {
+ schemaContext = reactor.buildEffective(sources);
+ } catch (IOException e1) {
+ throw new ExceptionInInitializerError(e1);
+ } catch (ReactorException e2) {
+ throw new RuntimeException("Unable to build schema context from " + sources, e2);
+ }
+ return schemaContext;
+ } catch (MalformedURLException e3) {
+ throw new RuntimeException("Malformed URL detected in " + file, e3);