File tree Expand file tree Collapse file tree 4 files changed +19
-7
lines changed
app/code/Magento/Customer/Model
dev/tests/integration/testsuite/Magento/Tax/Model/TaxClass
lib/internal/Magento/Framework/Exception/Customer Expand file tree Collapse file tree 4 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 24
24
use Magento \Framework \Exception \EmailNotConfirmedException ;
25
25
use Magento \Framework \Exception \InputException ;
26
26
use Magento \Framework \Exception \InvalidEmailOrPasswordException ;
27
+ use Magento \Framework \Exception \LocalizedException ;
27
28
use Magento \Framework \Exception \NoSuchEntityException ;
28
29
use Magento \Framework \Exception \State \ExpiredException ;
29
30
use Magento \Framework \Exception \State \InputMismatchException ;
@@ -511,10 +512,9 @@ public function createAccountWithPasswordHash(
511
512
try {
512
513
// If customer exists existing hash will be used by Repository
513
514
$ customer = $ this ->customerRepository ->save ($ customer , $ hash );
514
- } catch (\Magento \Customer \Exception $ e ) {
515
- if ($ e ->getCode () === CustomerModel::EXCEPTION_EMAIL_EXISTS ) {
516
- throw new InputMismatchException ('Customer with the same email already exists in associated website. ' );
517
- }
515
+ } catch (\Magento \Framework \Exception \Customer \Exception $ e ) {
516
+ throw new InputMismatchException ('Customer with the same email already exists in associated website. ' );
517
+ } catch (LocalizedException $ e ) {
518
518
throw $ e ;
519
519
}
520
520
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ protected function _getDefaultAttributes()
93
93
* @param \Magento\Framework\Object $customer
94
94
* @return $this
95
95
* @throws \Magento\Customer\Exception
96
- * @throws \Magento\Framework\Exception\LocalizedException
96
+ * @throws \Magento\Framework\Model\Exception
97
97
*/
98
98
protected function _beforeSave (\Magento \Framework \Object $ customer )
99
99
{
Original file line number Diff line number Diff line change @@ -66,8 +66,8 @@ public function testSave()
66
66
67
67
/**
68
68
* @magentoDbIsolation enabled
69
- * @expectedException \Magento\Framework\Exception\InputException
70
- * @expectedExceptionMessage A class with the same name already exists for ClassType PRODUCT .
69
+ * @expectedException \Magento\Framework\Exception\AlreadyExistsException
70
+ * @expectedExceptionMessage Class name and class type already exists.
71
71
*/
72
72
public function testSaveThrowsExceptionIfGivenTaxClassNameIsNotUnique ()
73
73
{
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © 2015 Magento. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ namespace Magento \Framework \Exception \Customer ;
7
+
8
+ use Magento \Framework \Exception \LocalizedException ;
9
+
10
+ class Exception extends LocalizedException
11
+ {
12
+ }
You can’t perform that action at this time.
0 commit comments