From d30d4a01485513aad8383ede4ae653fca9133318 Mon Sep 17 00:00:00 2001 From: florian <f.spreckelsen@inidscale.com> Date: Mon, 13 Jul 2020 10:50:03 +0200 Subject: [PATCH] ENH: id and name in error output --- src/caosdb/exceptions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/caosdb/exceptions.py b/src/caosdb/exceptions.py index 3b3d2ce4..52790715 100644 --- a/src/caosdb/exceptions.py +++ b/src/caosdb/exceptions.py @@ -369,8 +369,8 @@ class EntityError(TransactionError): def _repr_head(self, indent): if hasattr(self, 'entity') and self.entity is not None: - return (str(type(self.entity).__name__).upper() + " (" + - str(self.entity.id) + (("," + "'" + str(self.entity.name) + "'") if + return (str(type(self.entity).__name__).upper() + " (id: " + + str(self.entity.id) + ((", name: " + "'" + str(self.entity.name) + "'") if self.entity.name is not None else '') + ") CAUSED " + TransactionError._repr_head(self, indent)) else: -- GitLab