]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.structural2/src/org/simantics/structural2/scl/ReadComponentTypeInterfaceRequest.java
Some enhancements made by Antti for multiple readers
[simantics/platform.git] / bundles / org.simantics.structural2 / src / org / simantics / structural2 / scl / ReadComponentTypeInterfaceRequest.java
index a93cbe8d4237abc857aa5bbbaa742d6c9b2b7929..b50d1604f2ad82aed9f84420341a0c28233f178f 100644 (file)
@@ -8,11 +8,14 @@ import org.simantics.databoard.Bindings;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.common.request.ResourceRead;
+import org.simantics.db.common.utils.NameUtils;
 import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.layer0.scl.SCLDatabaseException;
 import org.simantics.db.layer0.util.Layer0Utils;
 import org.simantics.layer0.Layer0;
 import org.simantics.scl.compiler.environment.Environment;
 import org.simantics.scl.compiler.environment.Environments;
+import org.simantics.scl.compiler.errors.CompilationError;
 import org.simantics.scl.compiler.top.SCLExpressionCompilationException;
 import org.simantics.scl.compiler.types.Type;
 
@@ -38,8 +41,16 @@ public class ReadComponentTypeInterfaceRequest extends ResourceRead<Map<String,
                                try {
                                    type = Environments.getType(environment, typeName);
                                } catch(SCLExpressionCompilationException e) {
-                                   e.printStackTrace();
-                                   continue;
+                           StringBuilder b = new StringBuilder();
+                           b.append("Couldn't compile interface properties in type '" + NameUtils.getSafeName(graph, t) + " for environment " + environment);
+                           b.append("':\n");
+                           StringBuilder b2 = new StringBuilder();
+                           for(CompilationError error : e.getErrors()) {
+                               b2.append(error.description);
+                               b2.append('\n');
+                           }
+                           System.err.println(b.toString() + b2.toString());
+                           throw new SCLDatabaseException(b.toString()+b2.toString(), b2.toString(), e.getErrors());
                                }
                                ComponentTypeProperty property = new ComponentTypeProperty(relation, type);
                                result.put(name, property);