You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importpyblish.apiclassRaiseOldStyleExceptionPlugin(pyblish.api.InstancePlugin):
order=pyblish.api.ValidatorOrderlabel="Raise Python 2 old-style exception"defprocess(self, instance):
# define old style errorclassMyError:
pass# this will hang Pyblish-QML indefinitelyraiseMyError
Solution
Adding a bare except would already solve it, but potentially we should still ignore KeyInterupt, etc. so we should set up a clever capture that at least ignores the ones we want to explicitly ignore.
So we'll need to do something like:
try:
...
except (KeyboardInterrupt, SystemExit, GeneratorExit):
# Continue to raise these errors explicitly
raise
except as error:
# Capture any other error
The text was updated successfully, but these errors were encountered:
Looking a little closer, it looks like the issue may stem from here, where Exception and all of its subclasses are caught.
except as error:
Didn't know that was possible, but that would probably take care of it; it's the same same effect anyway, the only reason Exception is there is due to Flake8/PyLint warnings.
Issue
In Houdini we noticed that sometimes when a Houdini error was raised (that wasn't explicitly captured) in our plug-in that it would completely hang Pyblish QML. We found out that it was due to
hou.Error
not inheriting from the PythonException
and this code would not capture accordingly.See this reproducible code snippet that also hangs outside of Houdini:
Solution
Adding a bare except would already solve it, but potentially we should still ignore
KeyInterupt
, etc. so we should set up a clever capture that at least ignores the ones we want to explicitly ignore.So we'll need to do something like:
The text was updated successfully, but these errors were encountered: