Skip to content

Commit

Permalink
#145: Add exception to be caught when creating ICAT data
Browse files Browse the repository at this point in the history
  • Loading branch information
MRichards99 committed Oct 8, 2020
1 parent be3c797 commit d7741f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common/icat/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
ICATInternalError,
ICATObjectExistsError,
ICATNoObjectError,
ICATParameterError,
)
from common.exceptions import (
AuthenticationError,
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit d7741f7

Please sign in to comment.