biolab / orange3

🍊 :bar_chart: :bulb: Orange: Interactive data analysis
https://orangedatamining.com
Other
4.85k stars 1.01k forks source link

Raise Exception in Python Script Widget but continue to trigger execution of next widget #6782

Closed foongminwong closed 6 months ago

foongminwong commented 6 months ago

What's wrong? I have a simple flow that contains a try-except block and link to another widget.

When the first Python Script Widget throws an Exception, why does it trigger the next widget to execute?

Is there a way to disable the automatic execution of the next widget when an exception is thrown?

How can we reproduce the problem?

image

What's your environment?

janezd commented 6 months ago

Widget's output cannot be "inactive". If the widget cannot produce data (due to an error or another reason), it needs to output None, it must not keep the pre-existing state. (If any widget does so, we consider it a bug.)

Therefore, in you exception handler, you need to set out_object = None. It will still trigger output, but with correct data. The following widget must then react accordingly.