Is it possible to decorate these runAction
functions? I want to show any errors in the script to the user and maybe do other actions, but at the moment I just copy boiler plate code with try/except blocks, however I'd really like to globally define this in a script module as a decorator function to do what I want so that I can centrally manage it and modify it if I need.
Is this at all possible?
Most of the time I have the scripts I call defined within script modules, however if there's a typo or something preventing that function call from running, these will go silently by without the user knowing anything happened or that there was an error.
E.g.
@shared.decorators.runActions
def runAction(self, event):
sharred.prespective.sayHello() # typos in the module name prevents code from running, but won't be flagged without error handling