From 2870f9f6ec0c7af74a7b5335c04a1a322e8e7bbb Mon Sep 17 00:00:00 2001 From: andrefatchip Date: Sun, 5 Jan 2020 20:39:56 +0100 Subject: [PATCH] 0057197: Fixed fatal errors occured --- Services/Helper/AbstractHelper.php | 4 +++- Services/Helper/ShopwareArticleHelper.php | 4 +++- Services/Helper/ShopwareOrderHelper.php | 4 +++- Services/WriteData/Internal/WriteProductsService.php | 5 ++++- viaebShopwareAfterbuy.php | 3 ++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Services/Helper/AbstractHelper.php b/Services/Helper/AbstractHelper.php index 35f70a6..6c04fe3 100644 --- a/Services/Helper/AbstractHelper.php +++ b/Services/Helper/AbstractHelper.php @@ -182,7 +182,9 @@ public function createTax(float $rate) try { $this->entityManager->persist($tax); $this->entityManager->flush(); - } catch (OptimisticLockException | ORMException $e) { + } catch (OptimisticLockException $e) { + $this->logger->error('Error saving tax rule', array($rate)); + } catch (ORMException $e) { $this->logger->error('Error saving tax rule', array($rate)); } } diff --git a/Services/Helper/ShopwareArticleHelper.php b/Services/Helper/ShopwareArticleHelper.php index faaafe3..4c95c9f 100644 --- a/Services/Helper/ShopwareArticleHelper.php +++ b/Services/Helper/ShopwareArticleHelper.php @@ -73,7 +73,9 @@ public function fixMissingAttribute(ArticleDetail $detail) try { $this->entityManager->persist($detail); $this->entityManager->flush(); - } catch (OptimisticLockException | ORMException $e) { + } catch (OptimisticLockException $e) { + $this->logger->error('Error saving attribute'); + } catch (ORMException $e) { $this->logger->error('Error saving attribute'); } } diff --git a/Services/Helper/ShopwareOrderHelper.php b/Services/Helper/ShopwareOrderHelper.php index 9563d33..dfd5a61 100644 --- a/Services/Helper/ShopwareOrderHelper.php +++ b/Services/Helper/ShopwareOrderHelper.php @@ -357,7 +357,9 @@ public function setAfterBuyIds(array $values) try { $this->entityManager->flush(); - } catch (OptimisticLockException | ORMException $e) { + } catch (OptimisticLockException $e) { + $this->logger->error('Error storing afterbuy ids'); + } catch (ORMException $e) { $this->logger->error('Error storing afterbuy ids'); } } diff --git a/Services/WriteData/Internal/WriteProductsService.php b/Services/WriteData/Internal/WriteProductsService.php index dff6846..a17c4fa 100644 --- a/Services/WriteData/Internal/WriteProductsService.php +++ b/Services/WriteData/Internal/WriteProductsService.php @@ -68,7 +68,10 @@ public function send($targetData) { try { $this->entityManager->flush(); - } catch (OptimisticLockException | ORMException $e) { + } catch (OptimisticLockException $e) { + $this->logger->error('Error storing products', $targetData); + exit('Error storing products'); + } catch (ORMException $e) { $this->logger->error('Error storing products', $targetData); exit('Error storing products'); } diff --git a/viaebShopwareAfterbuy.php b/viaebShopwareAfterbuy.php index 2295883..5ec8c2d 100755 --- a/viaebShopwareAfterbuy.php +++ b/viaebShopwareAfterbuy.php @@ -145,7 +145,8 @@ public function fixDefaultValueTypes() ]); } } - } catch (Zend_Db_Adapter_Exception | Zend_Db_Statement_Exception $e) { + } catch (Zend_Db_Adapter_Exception $e) { + } catch (Zend_Db_Statement_Exception $e) { } }