ID 348567 - An error occurs if an exception comes before 'processor' is assigned to

Follow

Problem summary
An error occurs if an exception comes before 'processor' is assigned to. 

This results in the following error upon export in Nuke Studio 11.1v2 and newer:



And the following error on Nuke11.1v1 and older:

# Result: Traceback (most recent call last):
File "C:\Program Files\Nuke11.0v4\pythonextensions\site-packages\hiero\core\FnExportRegistry.py", line 829, in createAndExecuteProcessor
errorString = processor.errors()
UnboundLocalError: local variable 'processor' referenced before assignment

Steps to reproduce

1) Open Hiero

2) Open a Script Editor window (Window > Script Editor)

3) Run the following code:

def throw(*args, **kwargs):
raise RuntimeError("Test error handling")

from hiero.core import ProcessorBase
ProcessorBase.__init__ = throw

4) Import any file (File > Import File(s)...) and drag it onto the Timeline

5) Export the sequence (right click the clip on the Timeline > Export) and notice that it fails.

This bug seems to present itself in two different ways, depending on the version. In 11.1v2 you will get an error dialog similar to the following:

​​

And in 11.1v1, and earlier, you will get the following output in the Script Editor and the terminal:

# Result: Traceback (most recent call last):
File "C:\Program Files\Nuke11.0v4\pythonextensions\site-packages\hiero\core\FnExportRegistry.py", line 829, in createAndExecuteProcessor
errorString = processor.errors()
UnboundLocalError: local variable 'processor' referenced before assignment

Workaround
Unknown. If known please add steps to workaround or avoid the problem

Reproduced by support
This bug has been reproduced in:
Nuke Studio 11.1v3 - Windows 10 - Mac OSX El Capitan - Linux CentOS 6
Hiero 11.1v3 - Windows 10 - Mac OSX El Capitan - Linux CentOS 6
Hiero 11.0v4 - Windows 10
Hiero 11.0v1 - Windows 10
Hiero 10.5v7 - Windows 10
Hiero 10.5v1 - Windows 10
Hiero 10.0v6 - Windows 10
Hiero 10.0v1 - Windows 10
Hiero 9.0v9 - Windows 10
Hiero 9.0v7 - Windows 10
Hiero 1.9v1 - Windows 10
Hiero 1.8v2 - Windows 10 - Mac OSX El Capitan - Linux CentOS 6

Earliest version tested
Hiero 1.8v2 - Windows 10 - Mac OSX El Capitan - Linux CentOS 6
- This issue appears to be in all versions of the product

Expected behaviour
It should return the processor.errors() and the export should not fail.

Actual behaviour
The error is not caught and the export fails.

    We're sorry to hear that

    Please tell us why