Skip to content

Commit

Permalink
Improve the internalCallException to use Exception chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
Mads Møller committed Apr 5, 2018
1 parent 6c31ac1 commit 0f1d0f7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Exceptions/Exceptions/ApiInternalCallException.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ class ApiInternalCallException extends \RuntimeException
*/
protected $exceptionMessage;

/**
* @var \Exception
*/
protected $previousException;

/**
* @param Response $response
* @param string $message
Expand All @@ -24,6 +29,8 @@ public function __construct(Response $response, $message = 'There was an error w
{
$this->response = $response;
$this->exceptionMessage = $message;
$this->message = $message;
$this->previousException = $response->exception;
}

/**
Expand All @@ -41,4 +48,13 @@ public function getExceptionMessage()
{
return $this->exceptionMessage;
}

/**
* @return \Exception
*/
public function getPreviousException()
{
return $this->previousException;
}
}

0 comments on commit 0f1d0f7

Please sign in to comment.