import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ExecutionException;
+import javax.ws.rs.NotFoundException;
import javax.ws.rs.WebApplicationException;
import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.api.WriteTransaction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.yanglib.impl.rev141210.YanglibConfig;
import org.opendaylight.yanglib.api.YangLibService;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.model.repo.api.MissingSchemaSourceException;
import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation;
import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
final var yangTextSchemaSource = yangTextSchemaFuture.get();
return yangTextSchemaSource.asCharSource(StandardCharsets.UTF_8).read();
} catch (InterruptedException | 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);
} catch (IOException e) {
throw new WebApplicationException("Unable to read schema " + sourceId, e);