Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion HTTPClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ public function retrieveResponse(
throw new HttpTokenResponseException(
$msg . $http->error . ' [HTTP ' . $http->status . ']',
$http->status,
$http->error
$http->error,
$http->resp_body
);
}

Expand Down
14 changes: 14 additions & 0 deletions HttpTokenResponseException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,28 @@ class HttpTokenResponseException extends TokenResponseException
{
protected $httpStatusCode = 0;
protected $httpErrorMessage = "";
protected $httpRespBody = "";

/**
* @param string $message
* @param int $httpStatusCode
* @param string httpErrorMessage
* @param mixed httpRespBody
* @param int $code
* @param \Throwable|null $previous
*/
public function __construct(
$message = "",
$httpStatusCode = 0,
$httpErrorMessage = "",
$httpRespBody = "",
$code = 0,
\Throwable $previous = null
) {
parent::__construct($message, $code, $previous);
$this->httpStatusCode = $httpStatusCode;
$this->httpErrorMessage = $httpErrorMessage;
$this->httpRespBody = $httpRespBody;
}

/**
Expand All @@ -50,4 +54,14 @@ public function getHttpErrorMessage()
{
return $this->httpErrorMessage;
}

/**
* Get the HTTP response body
*
* @return mixed
*/
public function getHttpRespBody()
{
return $this->httpRespBody;
}
}