Skip to content

Commit c3f3a57

Browse files
committed
Remove unnecessary try/catch
1 parent 5c43558 commit c3f3a57

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,10 @@ public function execute()
9393

9494
$this->confirmByToken->execute($resetPasswordToken);
9595

96-
try {
97-
// Extend token validity to avoid expiration while this form is
98-
// being completed by the user.
99-
$customer = $this->getByToken->execute($resetPasswordToken);
100-
$this->accountManagement->changeResetPasswordLinkToken($customer, $resetPasswordToken);
101-
} catch (\Exception $exception) {
102-
// Intentionally ignoring failures here
103-
}
96+
// Extend token validity to avoid expiration while this form is
97+
// being completed by the user.
98+
$customer = $this->getByToken->execute($resetPasswordToken);
99+
$this->accountManagement->changeResetPasswordLinkToken($customer, $resetPasswordToken);
104100

105101
if ($isDirectLink) {
106102
$this->session->setRpToken($resetPasswordToken);

app/code/Magento/User/Controller/Adminhtml/Auth/ResetPassword.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,11 @@ public function execute()
2626
try {
2727
$this->_validateResetPasswordLinkToken($userId, $passwordResetToken);
2828

29-
try {
30-
// Extend token validity to avoid expiration while this form is
31-
// being completed by the user.
32-
$user = $this->_userFactory->create()->load($userId);
33-
$user->changeResetPasswordLinkToken($passwordResetToken);
34-
$user->save();
35-
} catch (\Exception $exception) {
36-
// Intentionally ignoring failures here
37-
}
29+
// Extend token validity to avoid expiration while this form is
30+
// being completed by the user.
31+
$user = $this->_userFactory->create()->load($userId);
32+
$user->changeResetPasswordLinkToken($passwordResetToken);
33+
$user->save();
3834

3935
$this->_view->loadLayout();
4036

0 commit comments

Comments
 (0)