Skip to content

Commit

Permalink
Re-adding exceptions removed mistakenly
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekFurstPitt committed Oct 17, 2023
1 parent 2bfc99a commit 7067a8d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4512,6 +4512,25 @@ def create_multiple_component_details(request, normalized_entity_type, user_toke
msg = "Failed to execute one of the 'before_create_trigger' methods, can't create the entity"
logger.exception(msg)
internal_server_error(msg)
except schema_errors.NoDataProviderGroupException:
# Log the full stack trace, prepend a line with our message
if 'group_uuid' in json_data_dict:
msg = "Invalid 'group_uuid' value, can't create the entity"
else:
msg = "The user does not have the correct Globus group associated with, can't create the entity"

logger.exception(msg)
bad_request_error(msg)
except schema_errors.UnmatchedDataProviderGroupException:
# Log the full stack trace, prepend a line with our message
msg = "The user does not belong to the given Globus group, can't create the entity"
logger.exception(msg)
forbidden_error(msg)
except schema_errors.MultipleDataProviderGroupException:
# Log the full stack trace, prepend a line with our message
msg = "The user has mutiple Globus groups associated with, please specify one using 'group_uuid'"
logger.exception(msg)
bad_request_error(msg)
except KeyError as e:
# Log the full stack trace, prepend a line with our message
logger.exception(e)
Expand Down

0 comments on commit 7067a8d

Please sign in to comment.