Skip to content

Commit

Permalink
For #35626, error handing on entity creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Matto committed Apr 11, 2016
1 parent 726e488 commit 56e53b3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions python/tk_multi_importcut/edl_cut.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,12 @@ def create_entity(self, create_playload):
:param create_payload: A list containing an entity type to be created
along with paramater values the user entered in the create_entity dialog.
"""
new_entity = self._sg.create(*create_playload)
self.retrieve_cuts(new_entity)
try:
new_entity = self._sg.create(*create_playload)
self.retrieve_cuts(new_entity)
except Exception, e:
self._logger.error("You do not have permission to create new %ss. \
Please select another %s or ask your Shotgun Admin to adjust your permissions in Shotgun." % (create_playload[0], create_playload[0]))

@QtCore.Slot(dict)
def retrieve_cuts(self, sg_entity):
Expand Down

0 comments on commit 56e53b3

Please sign in to comment.