Skip to content

Commit 463541f

Browse files
committed
ACP2E-4031: [QUANS] Confirm GQL order placement exception handling behaviour reversion
1 parent c0e5804 commit 463541f

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

app/code/Magento/QuoteGraphQl/Model/OrderErrorProcessor.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ public function execute(
4343
ContextInterface $context,
4444
ResolveInfo $info
4545
): void {
46-
if ($exception instanceof AuthorizationException) {
47-
throw new GraphQlAuthorizationException(
48-
__($exception->getMessage())
49-
);
50-
}
5146
$exception = $this->errorMessageFormatter->getFormatted(
5247
$exception,
5348
__('A server error stopped your order from being placed. ' .

app/code/Magento/QuoteGraphQl/Model/Resolver/PlaceOrder.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Framework\Exception\AuthorizationException;
1111
use Magento\Framework\Exception\LocalizedException;
1212
use Magento\Framework\GraphQl\Config\Element\Field;
13+
use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException;
1314
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
1415
use Magento\Framework\GraphQl\Query\ResolverInterface;
1516
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
@@ -56,8 +57,10 @@ public function resolve(Field $field, $context, ResolveInfo $info, ?array $value
5657
$cart = $this->getCartForCheckout->execute($maskedCartId, $userId, $storeId);
5758
$orderId = $this->placeOrder->execute($cart, $maskedCartId, $userId);
5859
$order = $this->orderRepository->get($orderId);
59-
} catch (AuthorizationException|LocalizedException $exception) {
60-
return $this->orderErrorProcessor->execute($exception, $field, $context, $info);
60+
} catch (AuthorizationException $exception) {
61+
throw new GraphQlAuthorizationException(__($exception->getMessage()));
62+
} catch (LocalizedException $exception) {
63+
$this->orderErrorProcessor->execute($exception, $field, $context, $info);
6164
}
6265

6366
return [

0 commit comments

Comments
 (0)