Skip to content

Commit c56f45a

Browse files
authored
Merge pull request #4 from wmccoubrey/hotfix/CallDeletedCallbackOnCustomerNotFoundException
Call onCustomerDeleted callback anyway when deleteCustomer throws CustomerNotFoundException
2 parents 7c27171 + fb66d1f commit c56f45a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/UseCases/PushDeletedToCyclopsUseCase.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Gcd\Cyclops\UseCases;
44

55
use Gcd\Cyclops\Entities\CyclopsCustomerListEntity;
6+
use Gcd\Cyclops\Exceptions\CustomerNotFoundException;
67
use Gcd\Cyclops\Exceptions\CyclopsException;
78
use Gcd\Cyclops\Services\CyclopsService;
89

@@ -24,6 +25,8 @@ public function execute(CyclopsCustomerListEntity $list, callable $onCustomerDel
2425
try {
2526
$this->cyclopsService->deleteCustomer($item->identity);
2627
$onCustomerDeleted($item);
28+
} catch (CustomerNotFoundException $exception) {
29+
$onCustomerDeleted($item);
2730
} catch (CyclopsException $exception) {
2831
}
2932
}

0 commit comments

Comments
 (0)