I’d like to be able to exit the Publisher app (tk-multi-publish2) if there is an error during collection. However, at the moment, I have the below code which raises a confirm dialog in Maya with the error details, but the raise statement for the CollectionError doesn’t stop execution of the app. Once the confirm dialog is closed, the publisher window still comes up.
try: # ~~~~~~~Collecty stuff~~~~~~~~ except Exception: error_msg = "ERROR DURING COLLECTION: %s" % traceback.format_exc() cmds.confirmDialog(title="Collector Error", message=error_msg, button=["OK"]) raise CollectionError(error_msg)
Is there any way to stop the publisher from executing if this code is reached?