@Override
 public void accept(ISerializationDiagnostic diagnostic) {
   if (diagnostic == null || diagnostic.getMessage() == null)
     throw new RuntimeException("Something went wrong during serialization");
   else if (diagnostic.getException() != null)
     throw new RuntimeException(diagnostic.getException());
   else {
     String msg = diagnostic.getMessage();
     if (diagnostic.getSemanticObject() != null)
       msg += "\nSemantic Object: " + EmfFormatter.objPath(diagnostic.getSemanticObject());
     if (diagnostic.getContext() != null)
       msg += "\nContext: " + new Context2NameFunction().getContextName(diagnostic.getContext());
     throw new RuntimeException(msg);
   }
 }
 @Override
 public void accept(ISerializationDiagnostic diagnostic) {
   if (diagnostic == null || diagnostic.getMessage() == null) System.err.println("error");
   else System.err.println("error " + diagnostic.getMessage());
 }