public function failTransaction($transaction_id, \Exception $error=null)
    {
        $params = array('status' => 'failed', 'failedTime' => \Tripod\Mongo\DateUtil::getMongoDate());
        if($error!=null)
        {
            $params['error'] = array('reason'=>$error->getMessage(), 'trace'=>$error->getTraceAsString());
        }

        $this->updateTransaction(
            array("_id" => $transaction_id),
            array('$set' => $params),
            array('w' => 1, 'upsert'=>true)
        );
    }
public function failTransaction($transaction_id, \Exception $error=null)
    {
        $params = array('status' => 'failed', 'failedTime' => \Tripod\Mongo\DateUtil::getMongoDate());
        if($error!=null)
        {
            $params['error'] = array('reason'=>$error->getMessage(), 'trace'=>$error->getTraceAsString());
        }

        $this->updateTransaction(
            array("_id" => $transaction_id),
            array('$set' => $params),
            array('w' => 1, 'upsert'=>true)
        );
    }
public function failTransaction ( $ transaction_id , \ Exception $ error = null ) { $ params = array ( 'status' => 'failed' , 'failedTime' => \ Tripod \ Mongo \ DateUtil :: getMongoDate ( ) ) ; if ( $ error != null ) { $ params [ 'error' ] = array ( 'reason' => $ error -> getMessage ( ) , 'trace' => $ error -> getTraceAsString ( ) ) ; } $ this -> updateTransaction ( array ( "_id" => $ transaction_id ) , array ( '$set' => $ params ) , array ( 'w' => 1 , 'upsert' => true ) ) ; }
Updates the status of a transaction to failed, and adds a fail time.
If you passed in an Exception, the exception is logged in the transaction log

@param string $transaction_id the id of the transaction you wish to set as failed
@param \Exception $error exception you wish to log
Updates the status of a transaction to failed and adds a fail time . If you passed in an Exception the exception is logged in the transaction log