Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

Commit

Permalink
Fixing stream handler errors and tagging release
Browse files Browse the repository at this point in the history
  • Loading branch information
mtdowling committed Dec 2, 2014
1 parent 05b4e5f commit 9187999
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# CHANGELOG

## 1.0.4 - 2014-12-01

* Added support for older versions of cURL that do not have CURLOPT_TIMEOUT_MS.
* Setting debug to `false` does not enable debug output.
* Added a fix to the StreamHandler to return a `FutureArrayInterface` when an
error occurs.

## 1.0.3 - 2014-11-03

* Setting the `header` stream option as a string to be compatible with GAE.
Expand Down
4 changes: 2 additions & 2 deletions src/Client/StreamHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ private function createErrorResponse($url, RingException $e)
$e = new ConnectException($e->getMessage(), 0, $e);
}

return [
return new CompletedFutureArray([
'status' => null,
'body' => null,
'headers' => [],
'effective_url' => $url,
'error' => $e
];
]);
}

/**
Expand Down
5 changes: 4 additions & 1 deletion tests/Client/StreamHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ public function testAddsErrorToResponse()
'headers' => ['host' => ['localhost:123']],
'client' => ['timeout' => 0.01],
]);

$this->assertInstanceOf(
'GuzzleHttp\Ring\Future\CompletedFutureArray',
$result
);
$this->assertNull($result['status']);
$this->assertNull($result['body']);
$this->assertEquals([], $result['headers']);
Expand Down

0 comments on commit 9187999

Please sign in to comment.