mirror of
https://github.com/predis/predis.git
synced 2026-08-19 01:51:40 +00:00
Pass a transaction instance as the first argument of Predis\Transaction\AbortedMultiExecException.
This commit is contained in:
@@ -5,5 +5,14 @@ namespace Predis\Transaction;
|
||||
use Predis\PredisException;
|
||||
|
||||
class AbortedMultiExecException extends PredisException {
|
||||
// Aborted MULTI/EXEC transactions
|
||||
private $_transaction;
|
||||
|
||||
public function __construct(MultiExecContext $transaction, $message, $code = null) {
|
||||
$this->_transaction = $transaction;
|
||||
parent::__construct($message, $code);
|
||||
}
|
||||
|
||||
public function getTransaction() {
|
||||
return $this->_transaction;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,9 +194,8 @@ class MultiExecContext {
|
||||
$reply = $this->_client->exec();
|
||||
if ($reply === null) {
|
||||
if ($attemptsLeft === 0) {
|
||||
throw new AbortedMultiExecException(
|
||||
'The current transaction has been aborted by the server'
|
||||
);
|
||||
$message = 'The current transaction has been aborted by the server';
|
||||
throw new AbortedMultiExecException($this, $message);
|
||||
}
|
||||
$this->reset();
|
||||
if (isset($this->_options['on_retry']) && is_callable($this->_options['on_retry'])) {
|
||||
|
||||
Reference in New Issue
Block a user