+def fail_on_exception(f):
+ """
+ This is a decorator meant for methods on the Action class. It
+ catches any exceptions thrown, sets the failed attribute to True and
+ rethrows the exception.
+ """
+ def inner(self, *args, **kwargs):
+ try:
+ f(self, *args, **kwargs)
+ except:
+ self.failed = True
+ raise
+ return inner
+