]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Finish exception handling in AdapterRegistry2 15/3915/1
authorjsimomaa <jani.simomaa@gmail.com>
Tue, 25 Feb 2020 13:26:33 +0000 (15:26 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 25 Feb 2020 16:34:06 +0000 (16:34 +0000)
gitlab #480

Change-Id: I339986806570a4373456e4fb92a7b7712f531f7b
(cherry picked from commit 8eea274269dd791b7ef95ca03bf891654e0c4ffc)

bundles/org.simantics.db.services/src/org/simantics/db/services/adaption/AdapterRegistry2.java

index fe9bab55201f188be514d33c2d21e702586be0a1..0db80b1b4f5cb48044709875cf3b821aabca4278 100644 (file)
@@ -34,7 +34,6 @@ import org.simantics.db.Session;
 import org.simantics.db.adaption.Adapter;
 import org.simantics.db.adaption.AdapterInstaller;
 import org.simantics.db.adaption.AdaptionService;
-import org.simantics.db.common.request.ReadRequest;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.request.Read;
 import org.simantics.db.services.adaption.reflection.AdaptingDynamicAdapter2;
@@ -96,15 +95,12 @@ public class AdapterRegistry2 {
     }
 
     private static void handleException(Exception e, String fileName) {
-        System.err.println("At " + fileName);
-        e.printStackTrace();
+        LOGGER.error("At {}", fileName, e);
     }
 
     private void handleException(Exception e, AdapterInstaller installer) {
         String desc = installerSources.get(installer);
-        if (desc != null)
-            System.err.println("At " + desc);
-        e.printStackTrace();
+        LOGGER.error("At {}, installer {}", desc, installer, e);
     }
 
     private void handleAdaptersDocument(Loader b, Document doc, String fileName) {
@@ -228,7 +224,6 @@ public class AdapterRegistry2 {
 
                     }, fileName);
         } catch (Exception e) {
-            e.printStackTrace();
             handleException(e, fileName);
         }
     }