Skip to content

Commit

Permalink
Updated stream/Request::send() to follow RequestErrorException API ch…
Browse files Browse the repository at this point in the history
…anges
  • Loading branch information
SilverFire committed Jan 26, 2017
1 parent 68752e3 commit 55f40a4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/stream/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ class Request extends AbstractRequest
],
];

/**
* @param array $options
* @return mixed
* @throws RequestErrorException
*/
public function send($options = [])
{
try {
Expand All @@ -44,8 +49,7 @@ public function send($options = [])
$responseHeaders = $http_response_header;
fclose($stream);
} catch (\Exception $e) {
$errorInfo = ['request' => $this];
throw new RequestErrorException($e->getMessage(), $errorInfo, $e->getCode(), $e);
throw new RequestErrorException($e->getMessage(), $this, $e->getCode(), $e);
}

return new $this->responseClass($this, $responseContent, $responseHeaders);
Expand Down

0 comments on commit 55f40a4

Please sign in to comment.