Skip to content

Commit

Permalink
PR-882 Simplify duplicated catch blocks
Browse files Browse the repository at this point in the history
Related #882

Signed-off-by: Anton Fedurtsya <anton@fedurtsya.com>
  • Loading branch information
Sieg committed Nov 8, 2021
1 parent ed6e6b6 commit 31970f1
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions source/Application/Controller/Admin/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

namespace OxidEsales\EshopCommunity\Application\Controller\Admin;

use OxidEsales\Eshop\Core\Exception\CookieException;
use OxidEsales\Eshop\Core\Exception\UserException;
use OxidEsales\Eshop\Core\ShopVersion;

Expand Down Expand Up @@ -119,15 +120,7 @@ public function checklogin()
\OxidEsales\Eshop\Core\Registry::getSession()->setVariable('currentadminshop', $iSubshop);
\OxidEsales\Eshop\Core\Registry::getConfig()->setShopId($iSubshop);
}
} catch (UserException $oEx) {
$myUtilsView->addErrorToDisplay($oEx);
$oStr = getStr();
$this->addTplParam('user', $oStr->htmlspecialchars($sUser));
$this->addTplParam('pwd', $oStr->htmlspecialchars($sPass));
$this->addTplParam('profile', $oStr->htmlspecialchars($sProfile));

return;
} catch (\OxidEsales\Eshop\Core\Exception\CookieException $oEx) {
} catch (UserException|CookieException $oEx) {
$myUtilsView->addErrorToDisplay($oEx);
$oStr = getStr();
$this->addTplParam('user', $oStr->htmlspecialchars($sUser));
Expand Down

0 comments on commit 31970f1

Please sign in to comment.