@@ -79,22 +79,22 @@ public function resolve(
79
79
$ guestMaskedCartId = $ args ['cart_id ' ];
80
80
$ storeId = (int )$ context ->getExtensionAttributes ()->getStore ()->getId ();
81
81
82
- $ this ->getCartForUser ->execute ($ guestMaskedCartId ,null , $ storeId );
82
+ $ this ->getCartForUser ->execute ($ guestMaskedCartId , null , $ storeId );
83
83
84
84
try {
85
85
$ this ->guestCartManagementInterface ->assignCustomer ($ guestMaskedCartId , $ currentUserId , $ storeId );
86
86
} catch (NoSuchEntityException $ e ) {
87
- $ message = $ e ->getMessage ();
88
- if (str_contains ($ message , 'No such entity with cartId = ' )) {
89
- $ message = __ ('Could not find a cart with ID "%masked_cart_id" ' , ['masked_cart_id ' => $ guestMaskedCartId ]);
90
- } else {
91
- $ message = __ ($ e ->getMessage ());
92
- }
93
- throw new GraphQlNoSuchEntityException ($ message , $ e );
87
+ throw new GraphQlNoSuchEntityException (
88
+ __ ('Could not find a cart with ID "%masked_cart_id" ' , ['masked_cart_id ' => $ guestMaskedCartId ]),
89
+ $ e
90
+ );
94
91
} catch (StateException $ e ) {
95
92
throw new GraphQlInputException (__ ($ e ->getMessage ()), $ e );
96
93
} catch (LocalizedException $ e ) {
97
- throw new GraphQlInputException (__ ('Unable to assign the customer to the guest cart: %message ' , ['message ' => $ e ->getMessage ()]), $ e );
94
+ throw new GraphQlInputException (
95
+ __ ('Unable to assign the customer to the guest cart: %message ' , ['message ' => $ e ->getMessage ()]),
96
+ $ e
97
+ );
98
98
}
99
99
100
100
try {
0 commit comments