From 50663fb80e93a3fed06d6527477729ad868f465a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Hannu=20Niemist=C3=B6?= Date: Mon, 30 Oct 2017 19:02:03 +0200 Subject: [PATCH] (refs #7562) Better handling of exceptions in procedural modules Change-Id: I7f8f4c14d34afe781984f7b1f5b037bef87d3a85 --- .../repository/ProceduralModuleSourceRepository.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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; } -- 2.47.1