Log throwables in DiagramViewerLoadJob instead of swallowing them 90/3590/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Wed, 20 Nov 2019 18:34:59 +0000 (20:34 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Wed, 20 Nov 2019 18:34:59 +0000 (20:34 +0200)
gitlab #420

Change-Id: I493d7eeb0a6a13a188578fe218d68de8e195080e

bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/diagramEditor/DiagramViewerLoadJob.java

index 62b1d028f8db6fb2004e8222010e04e29febe9e2..decf3356c68b1b72864f738ac1d6ac57b6fb1ea3 100644 (file)
@@ -24,9 +24,13 @@ import org.simantics.g2d.diagram.IDiagram;
 import org.simantics.modeling.ui.Activator;
 import org.simantics.utils.DataContainer;
 import org.simantics.utils.threads.ThreadUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class DiagramViewerLoadJob extends DatabaseJob {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(DiagramViewerLoadJob.class);
+
     private static final boolean PROFILE = false;
     private DiagramViewer        viewer;
 
@@ -108,6 +112,7 @@ public class DiagramViewerLoadJob extends DatabaseJob {
                         END(task);
                     } catch (Throwable t) {
                         viewer = null;
+                        LOGGER.error("Failed to complete loading of diagram {} in the canvas thread", viewer.diagramResource, t);
                     }
                 }
             });