From 8292ca528fe1b3229121ed81bd6d010adfe12cf0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <h.tomwoerden@indiscale.com>
Date: Thu, 6 Oct 2022 10:44:25 +0200
Subject: [PATCH] MAINT: add more verbose error message

---
 src/caosdb/apiutils.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/caosdb/apiutils.py b/src/caosdb/apiutils.py
index e378b39f..bd5b0eec 100644
--- a/src/caosdb/apiutils.py
+++ b/src/caosdb/apiutils.py
@@ -344,7 +344,13 @@ def merge_entities(entity_a: Entity, entity_b: Entity):
                         setattr(entity_a.get_property(key), attribute,
                                 diff_r2["properties"][key][attribute])
                     else:
-                        raise RuntimeError("Merge conflict.")
+                        raise RuntimeError(
+                            f"Merge conflict:\nEntity a ({entity_a.id}, {entity_a.name}) "
+                            f"has a Property '{key}' with {attribute}="
+                            f"{diff_r2['properties'][key][attribute]}\n"
+                            f"Entity b ({entity_b.id}, {entity_b.name}) "
+                            f"has a Property '{key}' with {attribute}="
+                            f"{diff_r1['properties'][key][attribute]}")
         else:
             # TODO: This is a temporary FIX for
             #       https://gitlab.indiscale.com/caosdb/src/caosdb-pylib/-/issues/105
-- 
GitLab