X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=netconf%2Fyanglib%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyanglib%2Fimpl%2FYangLibProvider.java;fp=netconf%2Fyanglib%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyanglib%2Fimpl%2FYangLibProvider.java;h=77b171af536156761ab1d03e7cee64dd981cdd79;hb=dabdb2d418a06778722d6d6fcab44383bdb2ec9b;hp=1a100aad279b41388c0ff44299ae0661b7a80cdd;hpb=e2651d0ba62aefcdc4a10b71f73098c6e28cef0c;p=netconf.git diff --git a/netconf/yanglib/src/main/java/org/opendaylight/yanglib/impl/YangLibProvider.java b/netconf/yanglib/src/main/java/org/opendaylight/yanglib/impl/YangLibProvider.java index 1a100aad27..77b171af53 100644 --- a/netconf/yanglib/src/main/java/org/opendaylight/yanglib/impl/YangLibProvider.java +++ b/netconf/yanglib/src/main/java/org/opendaylight/yanglib/impl/YangLibProvider.java @@ -196,13 +196,16 @@ public class YangLibProvider implements AutoCloseable, SchemaSourceListener, Yan try { final var yangTextSchemaSource = yangTextSchemaFuture.get(); return yangTextSchemaSource.asCharSource(StandardCharsets.UTF_8).read(); - } catch (InterruptedException | ExecutionException e) { + } catch (ExecutionException e) { if (e.getCause() instanceof MissingSchemaSourceException) { throw new NotFoundException("Schema source " + sourceId + " not found", e); } - throw new WebApplicationException("Unable to get schema " + sourceId, e); + throw new WebApplicationException("Unable to retrieve schema source " + sourceId, e); } catch (IOException e) { throw new WebApplicationException("Unable to read schema " + sourceId, e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new WebApplicationException("Retrieving schema source " + sourceId + " has been interrupted", e); } }