Skip to content

Commit 6c29c88

Browse files
author
Yuri Kovsher
committed
MAGETWO-33814: Change parent class of Model\Exception sub-classes to Localized
1 parent dfd8de3 commit 6c29c88

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

app/code/Magento/Catalog/Model/Indexer/Product/Flat/Action/Full.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function execute($ids = null)
2727
$this->_reindex($store->getId());
2828
}
2929
} catch (\Exception $e) {
30-
throw new \Magento\Framework\Exception\LocalizedException($e->getMessage(), $e->getCode(), $e);
30+
throw new \Magento\Framework\Exception\LocalizedException($e->getMessage(), [], $e);
3131
}
3232
return $this;
3333
}

app/code/Magento/Customer/Model/Customer.php

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,6 @@ class Customer extends \Magento\Framework\Model\AbstractExtensibleModel
6161

6262
const XML_PATH_GENERATE_HUMAN_FRIENDLY_ID = 'customer/create_account/generate_human_friendly_id';
6363

64-
/**
65-
* Codes of exceptions related to customer model
66-
*/
67-
const EXCEPTION_EMAIL_NOT_CONFIRMED = 1;
68-
69-
const EXCEPTION_INVALID_EMAIL_OR_PASSWORD = 2;
70-
71-
const EXCEPTION_INVALID_RESET_PASSWORD_LINK_TOKEN = 4;
72-
7364
const SUBSCRIBED_YES = 'yes';
7465

7566
const SUBSCRIBED_NO = 'no';
@@ -373,14 +364,12 @@ public function authenticate($login, $password)
373364
$this->loadByEmail($login);
374365
if ($this->getConfirmation() && $this->isConfirmationRequired()) {
375366
throw new \Magento\Framework\Exception\LocalizedException(
376-
__('This account is not confirmed.'),
377-
self::EXCEPTION_EMAIL_NOT_CONFIRMED
367+
__('This account is not confirmed.')
378368
);
379369
}
380370
if (!$this->validatePassword($password)) {
381371
throw new \Magento\Framework\Exception\LocalizedException(
382-
__('Invalid login or password.'),
383-
self::EXCEPTION_INVALID_EMAIL_OR_PASSWORD
372+
__('Invalid login or password.')
384373
);
385374
}
386375
$this->_eventManager->dispatch(
@@ -1262,8 +1251,7 @@ public function changeResetPasswordLinkToken($passwordLinkToken)
12621251
{
12631252
if (!is_string($passwordLinkToken) || empty($passwordLinkToken)) {
12641253
throw new \Magento\Framework\Exception\LocalizedException(
1265-
__('Invalid password reset token.'),
1266-
self::EXCEPTION_INVALID_RESET_PASSWORD_LINK_TOKEN
1254+
__('Invalid password reset token.')
12671255
);
12681256
}
12691257
$this->_getResource()->changeResetPasswordLinkToken($this, $passwordLinkToken);

0 commit comments

Comments
 (0)