From: Hannu Niemistö Date: Mon, 30 Oct 2017 17:02:03 +0000 (+0200) Subject: (refs #7562) Better handling of exceptions in procedural modules X-Git-Tag: v1.31.0~81 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F62%2F1162%2F3;p=simantics%2Fplatform.git (refs #7562) Better handling of exceptions in procedural modules Change-Id: I7f8f4c14d34afe781984f7b1f5b037bef87d3a85 --- diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/source/repository/ProceduralModuleSourceRepository.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/source/repository/ProceduralModuleSourceRepository.java index 4899f88ba..8d0d2e42e 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/source/repository/ProceduralModuleSourceRepository.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/source/repository/ProceduralModuleSourceRepository.java @@ -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; }