Skip to content
Snippets Groups Projects
Commit 5ee23b39 authored by Dimitris Bozelos's avatar Dimitris Bozelos
Browse files

Issue #3263786 Catch and log errors in transaction updates

parent 04a6014b
1 merge request!6Issue #3263786: Catch and log errors when a transaction update ails
......@@ -90,7 +90,22 @@ class UpdateManager implements UpdateManagerInterface {
$transactions = $storage->loadMultiple($transaction_ids);
foreach ($transactions as $transaction) {
$this->doUpdateTransaction($payment_type, $transaction);
// We catch and log errors so that we can proceed and update other
// transactions. Otherwise all transactions could be prevented from
// getting updated when a single transaction fails for some reason.
try {
$this->doUpdateTransaction($payment_type, $transaction);
}
catch (\Throwable $throwable) {
$this->logger->error(
'An error occurred while updating the transaction with ID "%transaction_id". Error type: "%error_type". Error message: @message.',
[
'%transaction_id' => $transaction->id(),
'%error_type' => get_class($throwable),
'@message' => $throwable->getMessage(),
]
);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment