Passing error to GH component from CPython


First of all, I have a Hops CPython component that I want to run once and then finish, which I have achieved using a Button that is connected to the Enabled input.

Now, what I would like to do is to pass custom exceptions to the component from Python. Is this possible? I’m assuming it’s not possible for the Hops component to display any errors while the Enabled is False, which it always is because I’m using the button. So maybe I instead need to use a Boolean toggle, but then I have the issue that the component keeps re-running over and over.

Below you can see the component solving, as well as the requests and responses made. The error is expected, but as you can see it keeps running over and over, which is not the behaviour I would like.