]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
(refs #7562) Better handling of exceptions in procedural modules 62/1162/3
authorHannu Niemistö <hannu.niemisto@semantum.fi>
Mon, 30 Oct 2017 17:02:03 +0000 (19:02 +0200)
committerHannu Niemistö <hannu.niemisto@semantum.fi>
Mon, 30 Oct 2017 17:35:47 +0000 (19:35 +0200)
Change-Id: I7f8f4c14d34afe781984f7b1f5b037bef87d3a85

bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/source/repository/ProceduralModuleSourceRepository.java

index 4899f88ba66e898f281c0156d527a43f773c7fa9..8d0d2e42e5aeb0306d8262a79c6da41484e390cd 100644 (file)
@@ -16,9 +16,13 @@ import org.simantics.scl.compiler.source.ModuleSource;
 import org.simantics.scl.compiler.source.PrecompiledModuleSource;
 import org.simantics.scl.compiler.source.repository.procedural.ProceduralValueDefinition;
 import org.simantics.scl.compiler.top.ValueNotFound;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public abstract class ProceduralModuleSourceRepository implements ModuleSourceRepository {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(ProceduralModuleSourceRepository.class);
+    
     public static final String PREFIX = "procedural:";
     
     protected abstract ModuleRepository getModuleRepository(UpdateListener listener);
@@ -44,6 +48,10 @@ public abstract class ProceduralModuleSourceRepository implements ModuleSourceRe
         try {
             values = sourceModule.getValue("values");
         } catch (ValueNotFound e) {
+            return null; // normal
+        } catch (Throwable e) {
+            // abnormal exception
+            LOGGER.error("Failed to find value " + moduleName + "/values", e);
             return null;
         }