else
return Simantics.getAvailableRequestProcessor().syncRequest(request);
} catch (DatabaseException e) {
- LOGGER.error("Failed to read graph module " + moduleName + ".", e);
+ LOGGER.error("Failed to read graph module {}.", moduleName, e);
return null;
}
}
@Override
public void exception(ReadGraph graph, Throwable t)
throws DatabaseException {
- t.printStackTrace();
+ LOGGER.error("Could not listen {}", this, t);
if(alreadyExecutedOnce && listener != null)
fireUpdate(graph);
}
+
+ @Override
+ public String toString() {
+ return moduleName + " " + listener + " (" + alreadyExecutedOnce + ") [" + getClass().toString() + "]";
+ }
};
public static class GraphModuleSource extends StringModuleSource {
try {
Simantics.getSession().syncRequest(new WriteModuleSource(getModuleName(), newSourceText));
} catch (DatabaseException e) {
- e.printStackTrace();
+ LOGGER.error("Could not update {} with newSourceText {}", this, newSourceText);
}
}
@Override
public void forAllModules(TObjectProcedure<String> procedure) {
+ THashSet<String> moduleURIs = null;
try {
- THashSet<String> moduleURIs = Simantics.getAvailableRequestProcessor().syncRequest(new Read<THashSet<String>>() {
+ moduleURIs = Simantics.getAvailableRequestProcessor().syncRequest(new Read<THashSet<String>>() {
@Override
public THashSet<String> perform(ReadGraph graph)
throws DatabaseException {
});
moduleURIs.forEach(procedure);
} catch (DatabaseException e) {
- e.printStackTrace();
+ LOGGER.error("Could not execute procedure {} for all modules {}", procedure, String.valueOf(moduleURIs), e);
}
}