Added extra error check.

It turns out that under some circumstances, the PHP HTTP stream
wrapper does not return an error code. Account for this.
This commit is contained in:
Matt Butcher
2012-01-03 14:31:22 -06:00
parent 04ac40f46c
commit 2db3ca87e6

View File

@@ -56,6 +56,10 @@ class PHPStreamTransport implements Transporter {
// intelligently.
if ($res === FALSE) {
$err = error_get_last();
if (empty($err['message'])) {
throw new \HPCloud\Exception("An unknown exception occurred while sending a request.");
}
$this->guessError($err['message']);
// Should not get here.