X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.structural.synchronization.client%2Fsrc%2Forg%2Fsimantics%2Fstructural%2Fsynchronization%2Fclient%2FSynchronizer.java;h=cfd5fe69b4ec3eac4129c38a0c526e1b5e8a6441;hp=2552192ef75dfa1f45d215c99855b87e91555a7d;hb=dd253bfd2c17044a7f8d2e02f682ce0f091e4830;hpb=42542a731384c850346a58e580770011ee3d4ba2 diff --git a/bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/client/Synchronizer.java b/bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/client/Synchronizer.java index 2552192ef..cfd5fe69b 100644 --- a/bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/client/Synchronizer.java +++ b/bundles/org.simantics.structural.synchronization.client/src/org/simantics/structural/synchronization/client/Synchronizer.java @@ -118,22 +118,26 @@ public class Synchronizer { } return result; } catch (MissingVariableValueException e) { - handler.reportProblem("Failed to read " + name + ". " + e.getMessage()); + handler.reportProblem("Failed to read " + name + ": " + e.getMessage()); Throwable cur = e; while((cur = cur.getCause()) != null) { if(!(cur instanceof MissingVariableValueException)) { - handler.reportProblem(cur.getMessage()); + handler.reportProblem(" " + getSafeDescription(cur)); } } } catch (Exception e) { - handler.reportProblem("Failed to serialize " + name + ": " + e.getMessage(), e); + handler.reportProblem("Failed to serialize " + name + ": " + getSafeDescription(e), e); } return null; } + private String getSafeDescription(Throwable cur) { + return cur.getClass().getName() + (cur == null || cur.getMessage() != null ? ": " + cur.getMessage() : ""); + } + Collection mapProperties(SynchronizationEventHandler handler, Variable child) throws DatabaseException { ArrayList result = new ArrayList(); for(Variable prop : child.getProperties(graph, StructuralResource2.URIs.SynchronizedRelation)) {