From d7741f74f390b92f7a95a634976af085050295ad Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 8 Oct 2020 13:18:08 +0000 Subject: [PATCH] #145: Add exception to be caught when creating ICAT data --- common/icat/helpers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index 1e033818..d1864196 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -12,6 +12,7 @@ ICATInternalError, ICATObjectExistsError, ICATNoObjectError, + ICATParameterError, ) from common.exceptions import ( AuthenticationError, @@ -883,7 +884,7 @@ def create_entities(client, table_name, data): new_entity.create() except (ICATValidationError, ICATInternalError) as e: raise PythonICATError(e) - except ICATObjectExistsError as e: + except (ICATObjectExistsError, ICATParameterError) as e: raise BadRequestError(e) created_data.append(get_entity_by_id(client, table_name, new_entity.id, True))