From 8621f3a74eab772c717a9ce71d1a878378faec17 Mon Sep 17 00:00:00 2001 From: florian <f.spreckelsen@inidscale.com> Date: Tue, 7 Jul 2020 16:17:48 +0200 Subject: [PATCH] WIP: new errors in datatype.py --- src/caosdb/common/datatype.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/caosdb/common/datatype.py b/src/caosdb/common/datatype.py index 246485c3..c6468c0f 100644 --- a/src/caosdb/common/datatype.py +++ b/src/caosdb/common/datatype.py @@ -25,7 +25,8 @@ import re -from ..exceptions import AmbiguityException, EntityDoesNotExistError +from ..exceptions import (AmbiguityException, EntityDoesNotExistError, + TransactionError) DOUBLE = "DOUBLE" REFERENCE = "REFERENCE" @@ -111,7 +112,8 @@ def get_id_of_datatype(datatype): "Name {} did not lead to unique result; Missing " "implementation".format(datatype)) elif len(res) != 1: - raise EntityDoesNotExistError( + ee = EntityDoesNotExistError( "No RecordType named {}".format(datatype)) + raise TransactionError(ee) return res[0].id -- GitLab