FEATURE: v0.5.3: Added StateMachine.onerror support. Set this to a function you
want to be called on every error for any task. Useful for logging.