Skip to content

Commit bf99349

Browse files
author
Bogdan Padalko
committed
Merge remote-tracking branch 'mainline/develop' into develop
2 parents d02c13d + 58d4e29 commit bf99349

File tree

628 files changed

+2708
-1990
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

628 files changed

+2708
-1990
lines changed

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MarkAsRead.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function execute()
2222
$notificationId
2323
);
2424
$this->messageManager->addSuccess(__('The message has been marked as Read.'));
25-
} catch (\Magento\Framework\Model\Exception $e) {
25+
} catch (\Magento\Framework\Exception\LocalizedException $e) {
2626
$this->messageManager->addError($e->getMessage());
2727
} catch (\Exception $e) {
2828
$this->messageManager->addException(

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MassMarkAsRead.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function execute()
2727
$this->messageManager->addSuccess(
2828
__('A total of %1 record(s) have been marked as Read.', count($ids))
2929
);
30-
} catch (\Magento\Framework\Model\Exception $e) {
30+
} catch (\Magento\Framework\Exception\LocalizedException $e) {
3131
$this->messageManager->addError($e->getMessage());
3232
} catch (\Exception $e) {
3333
$this->messageManager->addException(

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MassRemove.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function execute()
2525
}
2626
}
2727
$this->messageManager->addSuccess(__('Total of %1 record(s) have been removed.', count($ids)));
28-
} catch (\Magento\Framework\Model\Exception $e) {
28+
} catch (\Magento\Framework\Exception\LocalizedException $e) {
2929
$this->messageManager->addError($e->getMessage());
3030
} catch (\Exception $e) {
3131
$this->messageManager->addException($e, __("We couldn't remove the messages because of an error."));

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/Remove.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function execute()
2424
try {
2525
$model->setIsRemove(1)->save();
2626
$this->messageManager->addSuccess(__('The message has been removed.'));
27-
} catch (\Magento\Framework\Model\Exception $e) {
27+
} catch (\Magento\Framework\Exception\LocalizedException $e) {
2828
$this->messageManager->addError($e->getMessage());
2929
} catch (\Exception $e) {
3030
$this->messageManager->addException($e, __("We couldn't remove the messages because of an error."));

app/code/Magento/AdminNotification/Model/Inbox.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ public function parse(array $data)
107107
* @param string|string[] $description
108108
* @param string $url
109109
* @param bool $isInternal
110-
* @throws \Magento\Framework\Model\Exception
110+
* @throws \Magento\Framework\Exception\LocalizedException
111111
* @return $this
112112
*/
113113
public function add($severity, $title, $description, $url = '', $isInternal = true)
114114
{
115115
if (!$this->getSeverities($severity)) {
116-
throw new \Magento\Framework\Model\Exception(__('Wrong message type'));
116+
throw new \Magento\Framework\Exception\LocalizedException(__('Wrong message type'));
117117
}
118118
if (is_array($description)) {
119119
$description = '<ul><li>' . implode('</li><li>', $description) . '</li></ul>';

app/code/Magento/AdminNotification/Model/NotificationService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ public function __construct(\Magento\AdminNotification\Model\InboxFactory $notif
3030
*
3131
* @param int $notificationId
3232
* @return void
33-
* @throws \Magento\Framework\Model\Exception
33+
* @throws \Magento\Framework\Exception\LocalizedException
3434
*/
3535
public function markAsRead($notificationId)
3636
{
3737
$notification = $this->_notificationFactory->create();
3838
$notification->load($notificationId);
3939
if (!$notification->getId()) {
40-
throw new \Magento\Framework\Model\Exception('Wrong notification ID specified.');
40+
throw new \Magento\Framework\Exception\LocalizedException(__('Wrong notification ID specified.'));
4141
}
4242
$notification->setIsRead(1);
4343
$notification->save();

app/code/Magento/Authorization/Model/Acl/AclRetriever.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function getAllowedResourcesByUser($userType, $userId)
8383
} catch (\Exception $e) {
8484
$this->logger->critical($e);
8585
throw new LocalizedException(
86-
'Error happened while getting a list of allowed resources. Check exception log for details.'
86+
__('Error happened while getting a list of allowed resources. Check exception log for details.')
8787
);
8888
}
8989
return $allowedResources;

app/code/Magento/Authorization/Model/Resource/Rules.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ protected function _construct()
7373
*
7474
* @param \Magento\Authorization\Model\Rules $rule
7575
* @return void
76-
* @throws \Magento\Framework\Model\Exception
76+
* @throws \Magento\Framework\Exception\LocalizedException
7777
*/
7878
public function saveRel(\Magento\Authorization\Model\Rules $rule)
7979
{
@@ -115,7 +115,7 @@ public function saveRel(\Magento\Authorization\Model\Rules $rule)
115115

116116
$adapter->commit();
117117
$this->_aclCache->clean();
118-
} catch (\Magento\Framework\Model\Exception $e) {
118+
} catch (\Magento\Framework\Exception\LocalizedException $e) {
119119
$adapter->rollBack();
120120
throw $e;
121121
} catch (\Exception $e) {

app/code/Magento/Backend/App/Action/Plugin/Authentication.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?php
22
/**
3-
*
43
* Copyright © 2015 Magento. All rights reserved.
54
* See COPYING.txt for license details.
65
*/
76
namespace Magento\Backend\App\Action\Plugin;
87

8+
use Magento\Framework\Exception\AuthenticationException;
9+
910
class Authentication
1011
{
1112
/**
@@ -167,7 +168,7 @@ protected function _performLogin(\Magento\Framework\App\RequestInterface $reques
167168

168169
try {
169170
$this->_auth->login($username, $password);
170-
} catch (\Magento\Backend\Model\Auth\Exception $e) {
171+
} catch (AuthenticationException $e) {
171172
if (!$request->getParam('messageSent')) {
172173
$this->messageManager->addError($e->getMessage());
173174
$request->setParam('messageSent', true);

app/code/Magento/Backend/Block/Widget/Grid.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,15 @@ public function getColumnSet()
217217
/**
218218
* Retrieve export block
219219
*
220-
* @throws \Magento\Framework\Model\Exception
220+
* @throws \Magento\Framework\Exception\LocalizedException
221221
* @return \Magento\Framework\View\Element\AbstractBlock|bool
222222
*/
223223
public function getExportBlock()
224224
{
225225
if (!$this->getChildBlock('grid.export')) {
226-
throw new \Magento\Framework\Model\Exception('Export block for grid ' . $this->getNameInLayout() . ' is not defined');
226+
throw new \Magento\Framework\Exception\LocalizedException(
227+
__('Export block for grid %1 is not defined', $this->getNameInLayout())
228+
);
227229
}
228230
return $this->getChildBlock('grid.export');
229231
}

0 commit comments

Comments
 (0)