Raise KnownPublishError instead of assert

Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
This commit is contained in:
Roy Nieterau 2023-03-23 10:56:58 +01:00 committed by GitHub
parent 0b3cb6942d
commit 8b3ce3044a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,7 +13,8 @@ class SaveCurrentWorkfile(pyblish.api.ContextPlugin):
def process(self, context):
host = registered_host()
assert context.data['currentFile'] == host.get_current_workfile()
if context.data['currentFile'] != host.get_current_workfile():
raise KnownPublishError("Workfile has changed during publishing!")
if host.has_unsaved_changes():
self.log.info("Saving current file..")