def error_before_exec(value):
    if store_history:
        self.execution_count += 1
    result.error_before_exec = value
    self.last_execution_succeeded = False
    self.last_execution_result = result
    return result
def error_before_exec(value):
    if store_history:
        self.execution_count += 1
    result.error_before_exec = value
    self.last_execution_succeeded = False
    self.last_execution_result = result
    return result