|
10 | 10 | use Magento\Customer\Api\CustomerRepositoryInterface;
|
11 | 11 | use Magento\Framework\Exception\AlreadyExistsException;
|
12 | 12 | use Magento\Framework\Exception\LocalizedException;
|
13 |
| -use Magento\Framework\Exception\NoSuchEntityException; |
14 | 13 | use Magento\Framework\GraphQl\Exception\GraphQlAlreadyExistsException;
|
15 | 14 | use Magento\Framework\GraphQl\Exception\GraphQlAuthenticationException;
|
16 | 15 | use Magento\Framework\GraphQl\Exception\GraphQlInputException;
|
17 |
| -use Magento\Framework\GraphQl\Exception\GraphQlNoSuchEntityException; |
18 | 16 | use Magento\Store\Model\StoreManagerInterface;
|
19 | 17 | use Magento\Customer\Api\Data\CustomerInterface;
|
20 | 18 | use Magento\Framework\Api\DataObjectHelper;
|
@@ -78,18 +76,11 @@ public function __construct(
|
78 | 76 | * @return void
|
79 | 77 | * @throws GraphQlAlreadyExistsException
|
80 | 78 | * @throws GraphQlInputException
|
81 |
| - * @throws GraphQlNoSuchEntityException |
82 | 79 | * @throws GraphQlAuthenticationException
|
83 | 80 | */
|
84 | 81 | public function execute(int $customerId, array $data): void
|
85 | 82 | {
|
86 |
| - try { |
87 |
| - $customer = $this->customerRepository->getById($customerId); |
88 |
| - } catch (NoSuchEntityException $e) { |
89 |
| - throw new GraphQlNoSuchEntityException(__($e->getMessage()), $e); |
90 |
| - } catch (LocalizedException $e) { |
91 |
| - throw new GraphQlInputException(__($e->getMessage()), $e); |
92 |
| - } |
| 83 | + $customer = $this->customerRepository->getById($customerId); |
93 | 84 |
|
94 | 85 | $filteredData = array_diff_key($data, array_flip($this->restrictedKeys));
|
95 | 86 | $this->dataObjectHelper->populateWithArray($customer, $filteredData, CustomerInterface::class);
|
|
0 commit comments