Skip to content

Commit 3fae02a

Browse files
authored
Merge pull request #57 from shopware5/ntr/add-try-catch-to-transaction-report
NTR - Add try catch to transaction report
2 parents 0ad2eb5 + addeff3 commit 3fae02a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Components/TransactionReport/TransactionReport.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
use DateTime;
1212
use Doctrine\DBAL\Connection;
13+
use Exception;
1314
use GuzzleHttp\Client;
1415
use PDO;
1516
use Shopware\Models\Order\Status;
@@ -66,9 +67,12 @@ public function report($shopwareVersion, $instanceId, Client $client)
6667
'reportDataKeys' => ['turnover' => $reportResult->getTurnover($currency)],
6768
];
6869

69-
$client->post(self::POST_URL_ENDPOINT, ['json' => $requestBody]);
70-
71-
$this->deleteReportedOrders($reportResult->getOrderIds($currency));
70+
try {
71+
$client->post(self::POST_URL_ENDPOINT, ['json' => $requestBody]);
72+
$this->deleteReportedOrders($reportResult->getOrderIds($currency));
73+
} catch (Exception $e) {
74+
// nothing to do
75+
}
7276
}
7377
}
7478

0 commit comments

Comments
 (0)