Fix for country save on Customer info not handling BaseEnom correct exception

This commit is contained in:
Jérémy Munsch 2021-10-25 17:57:46 +02:00
parent f41b6ae644
commit 97ccbf0b1e
No known key found for this signature in database
GPG key ID: 55196BEE445F6049

View file

@ -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();