]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.structural2/src/org/simantics/structural2/StructuralRVIResolver.java
Replace instantiations of DatabaseException with more specific
[simantics/platform.git] / bundles / org.simantics.structural2 / src / org / simantics / structural2 / StructuralRVIResolver.java
index 8cf61b3e0ade8e4dc74ed2e44ca334d655a6ee0c..672edfca65c4bfc6995654fdd6b935e4cdb886e4 100644 (file)
@@ -127,16 +127,20 @@ public class StructuralRVIResolver extends StandardRVIResolver {
     @Override
     protected Variable resolveChild(ReadGraph graph, Variable variable, Resource resource) throws DatabaseException {
         Collection<Resource> path = getRVIPath(graph, variable, resource);
-        if(path == null) throw new MissingVariableException("Didn't find a variable related to " + resource + ".", resource);
-        for(Resource r : path) variable = variable.browse(graph, r);
+        if (path == null)
+            throw new MissingVariableException("Didn't find a variable related to " + resource + ".", resource);
+        for (Resource r : path)
+            variable = variable.browse(graph, r);
         return variable;
     }
-    
+
     @Override
     protected Variable resolveChild(ReadGraph graph, Variable variable, GuidRVIPart part) throws DatabaseException {
         Collection<Resource> path = getRVIPath(graph, variable, part);
-        if(path == null) throw new MissingVariableException("Didn't find a variable related to " + part + ".");
-        for(Resource r : path) variable = variable.browse(graph, r);
+        if (path == null)
+            throw new MissingVariableException("Didn't find a variable related to " + part + ".", variable.getPossibleRepresents(graph));
+        for (Resource r : path)
+            variable = variable.browse(graph, r);
         return variable;
     }