Skip to content

Commit 0136faf

Browse files
committed
turn InputMismatchException into GraphQlInputException
1 parent 906aeb2 commit 0136faf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/code/Magento/CustomerGraphQl/Model/Resolver/CreateCustomer.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Magento\Framework\Api\DataObjectHelper;
1717
use Magento\Framework\Exception\LocalizedException;
1818
use Magento\Framework\Exception\NoSuchEntityException;
19+
use Magento\Framework\Exception\State\InputMismatchException;
1920
use Magento\Framework\GraphQl\Config\Element\Field;
2021
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
2122
use Magento\Framework\GraphQl\Query\Resolver\ContextInterface;
@@ -117,6 +118,8 @@ public function resolve(
117118
$data = $this->customerDataProvider->getCustomerById($customerId);
118119
} catch (ValidatorException $e) {
119120
throw new GraphQlInputException(__($e->getMessage()));
121+
} catch (InputMismatchException $e) {
122+
throw new GraphQlInputException(__($e->getMessage()));
120123
}
121124

122125
return ['customer' => $data];

0 commit comments

Comments
 (0)