Skip to content

Commit

Permalink
Added possibility to define the $code constructor argument of Excepti…
Browse files Browse the repository at this point in the history
…ons when instantiating JsonApiExceptions
  • Loading branch information
kocsismate committed Sep 13, 2017
1 parent b840130 commit 7bf6a6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ REMOVED:

FIXED:

## 2.0.4 - 2017-09-13

Added:

- Possibility to define the `$code` constructor argument of `Exception`s when instantiating `JsonApiException`s

## 2.0.3 - 2017-08-24

CHANGED:
Expand Down
4 changes: 2 additions & 2 deletions src/JsonApi/Exception/JsonApiException.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ abstract class JsonApiException extends Exception implements JsonApiExceptionInt
*/
protected $errorDocument;

public function __construct(string $message = "")
public function __construct(string $message = "", int $code = 0)
{
parent::__construct($message);
parent::__construct($message, $code);
}

protected function createErrorDocument(): AbstractErrorDocument
Expand Down

0 comments on commit 7bf6a6e

Please sign in to comment.