From 97ccbf0b1ed4bf64cbfc2a8899eba3065468e778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Mon, 25 Oct 2021 17:57:46 +0200 Subject: [PATCH] Fix for country save on Customer info not handling BaseEnom correct exception --- app/Models/CustomerInfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/CustomerInfo.php b/app/Models/CustomerInfo.php index e657fc6..829b680 100644 --- a/app/Models/CustomerInfo.php +++ b/app/Models/CustomerInfo.php @@ -44,7 +44,7 @@ class CustomerInfo extends Model if (ctype_digit($customerInfo->country)) { try { $customerInfo->newcountry = Country::make((int)$customerInfo->country); - } catch (\TypeError $e) { + } catch (\BadMethodCallException $e) { // TODO change this when country column is updated // Set afghanistan as default country for now $customerInfo->newcountry = Country::afghanistan(); @@ -68,7 +68,7 @@ class CustomerInfo extends Model if (ctype_digit($customerInfo->country)) { try { $customerInfo->newcountry = Country::make((int)$customerInfo->country); - } catch (\TypeError $e) { + } catch (\BadMethodCallException $e) { // TODO change this when country column is updated // Set afghanistan as default country for now $customerInfo->newcountry = Country::afghanistan();