Skip to content

Commit 17726ef

Browse files
authored
Merge pull request #180 from magento-troll/sprint15
EPAM Sprint15
2 parents 8add899 + 45e4724 commit 17726ef

File tree

13 files changed

+36
-11
lines changed

13 files changed

+36
-11
lines changed

app/code/Magento/Authorizenet/Controller/Directpost/Payment/Place.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ protected function placeCheckoutOrder()
131131
$result->setData('error_messages', $exception->getMessage());
132132
} catch (\Exception $exception) {
133133
$result->setData('error', true);
134-
$result->setData('error_messages', __('Unable to place order. Please try again later.'));
134+
$result->setData(
135+
'error_messages',
136+
__('An error occurred on the server. Please try to place the order again.')
137+
);
135138
}
136139
if ($response instanceof Http) {
137140
$response->representJson($this->jsonHelper->jsonEncode($result));

app/code/Magento/Authorizenet/Test/Unit/Controller/Directpost/Payment/PlaceTest.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,10 @@ public function textExecuteFailedPlaceOrderDataProvider()
280280
{
281281
$objectFailed = new \Magento\Framework\DataObject();
282282
$objectFailed->setData('error', true);
283-
$objectFailed->setData('error_messages', __('Unable to place order. Please try again later.'));
283+
$objectFailed->setData(
284+
'error_messages',
285+
__('An error occurred on the server. Please try to place the order again.')
286+
);
284287

285288
return [
286289
[

app/code/Magento/Authorizenet/i18n/en_US.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"Order saving error: %1","Order saving error: %1"
33
"Please choose a payment method.","Please choose a payment method."
44
"We can\'t process your order right now. Please try again later.","We can\'t process your order right now. Please try again later."
5-
"Unable to place order. Please try again later.","Unable to place order. Please try again later."
5+
"An error occurred on the server. Please try to place the order again.","An error occurred on the server. Please try to place the order again."
66
"Credit Card: xxxx-%1","Credit Card: xxxx-%1"
77
"amount %1","amount %1"
88
failed.,failed.

app/code/Magento/Checkout/Model/GuestPaymentInformationManagement.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ public function savePaymentInformationAndPlaceOrder(
8080
try {
8181
$orderId = $this->cartManagement->placeOrder($cartId);
8282
} catch (\Exception $e) {
83-
throw new CouldNotSaveException(__('Unable to place order. Please try again later.'), $e);
83+
throw new CouldNotSaveException(
84+
__('An error occurred on the server. Please try to place the order again.'),
85+
$e
86+
);
8487
}
8588
return $orderId;
8689
}

app/code/Magento/Checkout/Model/PaymentInformationManagement.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ public function savePaymentInformationAndPlaceOrder(
6868
try {
6969
$orderId = $this->cartManagement->placeOrder($cartId);
7070
} catch (\Exception $e) {
71-
throw new CouldNotSaveException(__('Unable to place order. Please try again later.'), $e);
71+
throw new CouldNotSaveException(
72+
__('An error occurred on the server. Please try to place the order again.'),
73+
$e
74+
);
7275
}
7376
return $orderId;
7477
}

app/code/Magento/Checkout/Test/Unit/Model/GuestPaymentInformationManagementTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function testSavePaymentInformationAndPlaceOrder()
9393
}
9494

9595
/**
96-
* @expectedExceptionMessage Unable to place order. Please try again later.
96+
* @expectedExceptionMessage An error occurred on the server. Please try to place the order again.
9797
* @expectedException \Magento\Framework\Exception\CouldNotSaveException
9898
*/
9999
public function testSavePaymentInformationAndPlaceOrderException()

app/code/Magento/Checkout/Test/Unit/Model/PaymentInformationManagementTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function testSavePaymentInformationAndPlaceOrder()
7070
}
7171

7272
/**
73-
* @expectedExceptionMessage Unable to place order. Please try again later.
73+
* @expectedExceptionMessage An error occurred on the server. Please try to place the order again.
7474
* @expectedException \Magento\Framework\Exception\CouldNotSaveException
7575
*/
7676
public function testSavePaymentInformationAndPlaceOrderException()

app/code/Magento/Checkout/i18n/en_US.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Checkout,Checkout
4040
"This quote item does not exist.","This quote item does not exist."
4141
"Display number of items in cart","Display number of items in cart"
4242
"Display item quantities","Display item quantities"
43-
"Unable to place order. Please try again later.","Unable to place order. Please try again later."
43+
"An error occurred on the server. Please try to place the order again.","An error occurred on the server. Please try to place the order again."
4444
"Shipping address is not set","Shipping address is not set"
4545
"Unable to save address. Please check input data.","Unable to save address. Please check input data."
4646
"Carrier with such method not found: %1, %2","Carrier with such method not found: %1, %2"

app/code/Magento/Customer/Controller/Account/LoginPost.php

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Magento\Framework\Exception\EmailNotConfirmedException;
1414
use Magento\Framework\Exception\AuthenticationException;
1515
use Magento\Framework\Data\Form\FormKey\Validator;
16+
use Magento\Framework\Exception\LocalizedException;
1617
use Magento\Framework\Exception\State\UserLockedException;
1718
use Magento\Framework\App\Config\ScopeConfigInterface;
1819

@@ -179,6 +180,10 @@ public function execute()
179180
$message = __('Invalid login or password.');
180181
$this->messageManager->addError($message);
181182
$this->session->setUsername($login['username']);
183+
} catch (LocalizedException $e) {
184+
$message = $e->getMessage();
185+
$this->messageManager->addError($message);
186+
$this->session->setUsername($login['username']);
182187
} catch (\Exception $e) {
183188
// PA DSS violation: throwing or logging an exception here can disclose customer password
184189
$this->messageManager->addError(

app/code/Magento/Customer/Controller/Ajax/Login.php

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Magento\Framework\App\ObjectManager;
1313
use Magento\Customer\Model\Account\Redirect as AccountRedirect;
1414
use Magento\Framework\App\Config\ScopeConfigInterface;
15+
use Magento\Framework\Exception\LocalizedException;
1516

1617
/**
1718
* Login controller
@@ -182,6 +183,11 @@ public function execute()
182183
'errors' => true,
183184
'message' => $e->getMessage()
184185
];
186+
} catch (LocalizedException $e) {
187+
$response = [
188+
'errors' => true,
189+
'message' => $e->getMessage()
190+
];
185191
} catch (\Exception $e) {
186192
$response = [
187193
'errors' => true,

app/code/Magento/Payment/view/frontend/templates/transparent/iframe.phtml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ $params = $block->getParams();
3939
var parent = window.top;
4040
$(parent).trigger('clearTimeout');
4141
globalMessageList.addErrorMessage({
42-
message: $t('Unable to place order. Please try again later.')
42+
message: $t('An error occurred on the server. Please try to place the order again.')
4343
});
4444
}
4545
);

app/code/Magento/Quote/Model/QuoteManagement.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,9 @@ public function placeOrder($cartId, PaymentInterface $paymentMethod = null)
349349
$order = $this->submit($quote);
350350

351351
if (null == $order) {
352-
throw new LocalizedException(__('Unable to place order. Please try again later.'));
352+
throw new LocalizedException(
353+
__('An error occurred on the server. Please try to place the order again.')
354+
);
353355
}
354356

355357
$this->checkoutSession->setLastQuoteId($quote->getId());

app/code/Magento/Quote/i18n/en_US.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Subtotal,Subtotal
3636
"Cannot assign customer to the given cart. The cart belongs to different store.","Cannot assign customer to the given cart. The cart belongs to different store."
3737
"Cannot assign customer to the given cart. The cart is not anonymous.","Cannot assign customer to the given cart. The cart is not anonymous."
3838
"Cannot assign customer to the given cart. Customer already has active cart.","Cannot assign customer to the given cart. Customer already has active cart."
39-
"Unable to place order. Please try again later.","Unable to place order. Please try again later."
39+
"An error occurred on the server. Please try to place the order again.","An error occurred on the server. Please try to place the order again."
4040
"This item price or quantity is not valid for checkout.","This item price or quantity is not valid for checkout."
4141
"Please check the shipping address information. %1","Please check the shipping address information. %1"
4242
"Please specify a shipping method.","Please specify a shipping method."

0 commit comments

Comments
 (0)