Skip to content

Commit

Permalink
throw exception code from previous exception
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtsiomBruneuski authored and gelanivishal committed Oct 12, 2018
1 parent beeecaf commit 7e38326
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
*/
class Validator
{
const INVALID_ANNOTATIONS = 123;
/**
* @var TypeProcessor
*/
Expand Down Expand Up @@ -50,7 +49,7 @@ public function validateResponseSchemaType($responseSchema, $topicName)
} catch (\InvalidArgumentException $e) {
throw new \LogicException(
'Response schema definition has wrong annotations',
self::INVALID_ANNOTATIONS,
$e->getCode(),
$e
);
} catch (\Exception $e) {
Expand All @@ -77,7 +76,7 @@ public function validateRequestSchemaType($requestSchema, $topicName)
} catch (\InvalidArgumentException $e) {
throw new \LogicException(
'Response schema definition has wrong annotations',
self::INVALID_ANNOTATIONS,
$e->getCode(),
$e
);
} catch (\Exception $e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function setUp()

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


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

/**
* @expectedException \LogicException
* @expectedExceptionCode 123
* @expectedExceptionCode 333
*/
public function testValidateResponseSchemaType()
{
Expand All @@ -43,7 +43,7 @@ public function testValidateResponseSchemaType()

/**
* @expectedException \LogicException
* @expectedExceptionCode 123
* @expectedExceptionCode 333
*/
public function testValidateRequestSchemaType()
{
Expand Down

0 comments on commit 7e38326

Please sign in to comment.