From: Hannu Niemistö Date: Thu, 19 Jan 2017 08:55:04 +0000 (+0200) Subject: Log an exception in ModuleSourceRepository X-Git-Tag: v1.27.0~17 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=c50bc3cc6be9e1d21793c2e9c6777ca933d3a043;p=simantics%2Fplatform.git Log an exception in ModuleSourceRepository The previous implementation just printed exception to console. refs #5920 Change-Id: Icd317b670403db0987c740a216c2f69f72427d09 --- diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/scl/OntologyModuleSourceRepository.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/scl/OntologyModuleSourceRepository.java index 6fbcfd8e9..1e9df2e19 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/scl/OntologyModuleSourceRepository.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/scl/OntologyModuleSourceRepository.java @@ -13,11 +13,15 @@ import org.simantics.scl.compiler.source.ModuleSource; import org.simantics.scl.compiler.source.PrecompiledModuleSource; import org.simantics.scl.compiler.source.repository.ModuleSourceRepository; import org.simantics.scl.runtime.SCLContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import gnu.trove.procedure.TObjectProcedure; public enum OntologyModuleSourceRepository implements ModuleSourceRepository { INSTANCE; + + private static final Logger LOGGER = LoggerFactory.getLogger(OntologyModuleSourceRepository.class); static class ModuleSourceRequest extends UnaryRead { @@ -47,7 +51,7 @@ public enum OntologyModuleSourceRepository implements ModuleSourceRepository { return Simantics.getSession().syncRequest(new ModuleSourceRequest(moduleName)); } catch(DatabaseException e) { - e.printStackTrace(); + LOGGER.error("Failed to read ontology module " + moduleName + ".", e); return null; } }