]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/StandardRVIResolver.java
Merge "Fixed ProfileObserver.update race with multiple query threads"
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / variable / StandardRVIResolver.java
index b01aeb32b3c810c6347b96aa01bb6bc2e8feb41c..7c7ba292d851d8bfde2cbf1f13d2fe3713885848 100644 (file)
@@ -40,7 +40,7 @@ public class StandardRVIResolver implements RVIResolver {
             Variable parent = variable.getParent(graph);
             if (parent == null)
                 // TODO: consider using a more suitable exception here to better convey the situation.
-                throw new MissingVariableException("no parent for variable " + variable + " (URI=" + variable.getURI(graph) + ")");
+                throw new MissingVariableException("no parent for variable " + variable + " (URI=" + variable.getURI(graph) + ")", variable.getPossibleRepresents(graph));
             RVI base = graph.syncRequest(new VariableRVIRequest(parent));
             RVIPart part = getRVIPart(graph, variable);
             return new RVIBuilder(base).append(part).toRVI();
@@ -90,7 +90,7 @@ public class StandardRVIResolver implements RVIResolver {
                                return child;
                }
        }
-       throw new DatabaseException("Could not resolve child " + part);
+       throw new MissingVariableException("Could not resolve child " + part, variable.getPossibleRepresents(graph));
     }
 
     public static Variable resolvePropertyDefault(ReadGraph graph, Variable variable, GuidRVIPart part) throws DatabaseException {
@@ -102,7 +102,7 @@ public class StandardRVIResolver implements RVIResolver {
                                return child;
                }
        }
-       throw new DatabaseException("Could not resolve property " + part);
+       throw new MissingVariableException("Could not resolve property " + part, variable.getPossibleRepresents(graph));
     }
 
     @Override
@@ -120,7 +120,7 @@ public class StandardRVIResolver implements RVIResolver {
             if(Role.CHILD.equals(grp.getRole())) return resolveChild(graph, context, grp);
             else if(Role.PROPERTY.equals(grp.getRole())) return resolveProperty(graph, context, grp);
         }
-        throw new DatabaseException("Unrecognized RVIPart: " + part);
+        throw new MissingVariableException("Unrecognized RVIPart: " + part, context.getPossibleRepresents(graph));
     }
 
 }