]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Log an exception in ModuleSourceRepository 76/276/1
authorHannu Niemistö <hannu.niemisto@semantum.fi>
Thu, 19 Jan 2017 08:55:04 +0000 (10:55 +0200)
committerHannu Niemistö <hannu.niemisto@semantum.fi>
Thu, 19 Jan 2017 08:55:04 +0000 (10:55 +0200)
The previous implementation just printed exception to console.

refs #5920

Change-Id: Icd317b670403db0987c740a216c2f69f72427d09

bundles/org.simantics.modeling/src/org/simantics/modeling/scl/OntologyModuleSourceRepository.java

index 6fbcfd8e973f50597bbf975d3c2b2461e21052a8..1e9df2e192ae1a2fe0f9ab952ce4e3c15eb313fb 100644 (file)
@@ -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<String, ModuleSource> {
 
@@ -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;
         }
     }