From c8e1aa32c3fc08a697df4ff80206375980e46842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ph=E1=BA=A1m=20Qu=E1=BB=91c=20=C4=90=E1=BA=A1t?= Date: Wed, 6 Jun 2018 17:35:54 +0200 Subject: [PATCH] Bug in cron --- classes/SplitpaymentDeadline.php | 2 +- controllers/front/cron.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/classes/SplitpaymentDeadline.php b/classes/SplitpaymentDeadline.php index 0fc077f..bba863f 100644 --- a/classes/SplitpaymentDeadline.php +++ b/classes/SplitpaymentDeadline.php @@ -182,7 +182,7 @@ public function pay($update = false) $this->status = SplitpaymentDeadline::STATUS_FAILED; $message = Tools::displayError("An error occurred while trying to pay split payment. Error code: " . $res->lwError->CODE . " - Message: " . $res->lwError->MSG); - throw new Exception($message, $res->lwError->CODE); + throw new Exception($message, (int)$res->lwError->CODE); } else { Logger::AddLog(print_r($res, true)); diff --git a/controllers/front/cron.php b/controllers/front/cron.php index 76594eb..4a3f889 100644 --- a/controllers/front/cron.php +++ b/controllers/front/cron.php @@ -56,7 +56,12 @@ public function postProcess() /* @var $splitpayment SplitpaymentDeadline */ foreach ($splitpaymentCollection as $splitpayment) { - $splitpayment->pay(true); + try { + $splitpayment->pay(true); + } catch (Exception $e) { + echo $e; + continue; + } } $this->setRunningState(false);