diff --git a/CHANGELOG.md b/CHANGELOG.md index e59903e..d262127 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,18 @@ # Change Log -## Unreleased +## 1.3.0 + + * Make sure `Stream::__toString` never throws exception + * Added more exception + * `BrokenPipeException` + * `ConnectionException` + * `InvalidRequestException` + * `SSLConnectionException` + +## 1.2.0 + + * Dropped PHP 5.4 support + * Using stable version of `php-http/discovery` ## 1.1.0 diff --git a/src/Stream.php b/src/Stream.php index 9f5677f..507f135 100644 --- a/src/Stream.php +++ b/src/Stream.php @@ -59,7 +59,11 @@ public function __construct($socket, $size = null) */ public function __toString() { - return (string) $this->getContents(); + try { + return $this->getContents(); + } catch (\Exception $e) { + return ''; + } } /**