Skip to content

Commit 7e38326

Browse files
ArtsiomBruneuskigelanivishal
authored andcommitted
throw exception code from previous exception
1 parent beeecaf commit 7e38326

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

lib/internal/Magento/Framework/Communication/Config/Validator.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
*/
1414
class Validator
1515
{
16-
const INVALID_ANNOTATIONS = 123;
1716
/**
1817
* @var TypeProcessor
1918
*/
@@ -50,7 +49,7 @@ public function validateResponseSchemaType($responseSchema, $topicName)
5049
} catch (\InvalidArgumentException $e) {
5150
throw new \LogicException(
5251
'Response schema definition has wrong annotations',
53-
self::INVALID_ANNOTATIONS,
52+
$e->getCode(),
5453
$e
5554
);
5655
} catch (\Exception $e) {
@@ -77,7 +76,7 @@ public function validateRequestSchemaType($requestSchema, $topicName)
7776
} catch (\InvalidArgumentException $e) {
7877
throw new \LogicException(
7978
'Response schema definition has wrong annotations',
80-
self::INVALID_ANNOTATIONS,
79+
$e->getCode(),
8180
$e
8281
);
8382
} catch (\Exception $e) {

lib/internal/Magento/Framework/Test/Unit/Communication/Config/ValidatorTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function setUp()
1717

1818
$this->methodsMap->expects(static::any())
1919
->method('getMethodsMap')
20-
->will($this->throwException(new \InvalidArgumentException()));
20+
->will($this->throwException(new \InvalidArgumentException('message', 333)));
2121

2222

2323
$this->typeProcessor = $this->createMock(TypeProcessor::class);
@@ -32,7 +32,7 @@ public function setUp()
3232

3333
/**
3434
* @expectedException \LogicException
35-
* @expectedExceptionCode 123
35+
* @expectedExceptionCode 333
3636
*/
3737
public function testValidateResponseSchemaType()
3838
{
@@ -43,7 +43,7 @@ public function testValidateResponseSchemaType()
4343

4444
/**
4545
* @expectedException \LogicException
46-
* @expectedExceptionCode 123
46+
* @expectedExceptionCode 333
4747
*/
4848
public function testValidateRequestSchemaType()
4949
{

0 commit comments

Comments
 (0)