From efd3ae0e402e25e0567362b6887b6b3300b7d848 Mon Sep 17 00:00:00 2001 From: Max Baranikov Date: Fri, 28 Apr 2023 21:23:58 +0400 Subject: [PATCH] Added saving builder errors in orders export --- retailcrm/lib/RetailcrmExport.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/retailcrm/lib/RetailcrmExport.php b/retailcrm/lib/RetailcrmExport.php index 1a6cc11..cd161a9 100644 --- a/retailcrm/lib/RetailcrmExport.php +++ b/retailcrm/lib/RetailcrmExport.php @@ -184,8 +184,18 @@ class RetailcrmExport try { $orders[] = $orderBuilder->buildOrderWithPreparedCustomer(); } catch (Exception $exception) { + RetailcrmExportOrdersHelper::updateExportState( + $record['id_order'], + null, + [$exception->getMessage()] + ); self::handleError($record['id_order'], $exception); } catch (Error $exception) { + RetailcrmExportOrdersHelper::updateExportState( + $record['id_order'], + null, + [$exception->getMessage()] + ); self::handleError($record['id_order'], $exception); }