}
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<SerializedVariable> mapProperties(SynchronizationEventHandler handler, Variable child) throws DatabaseException {
ArrayList<SerializedVariable> result = new ArrayList<SerializedVariable>();
for(Variable prop : child.getProperties(graph, StructuralResource2.URIs.SynchronizedRelation)) {