From ab560a86954fbb6c21f9725f1302cc2cf8eb0eb0 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Thu, 5 Aug 2010 16:12:49 +0200 Subject: [PATCH] Enable track_errors. --- framework/Http/lib/Horde/Http/Response/Fopen.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/framework/Http/lib/Horde/Http/Response/Fopen.php b/framework/Http/lib/Horde/Http/Response/Fopen.php index 4d8b4052b..e681069f3 100644 --- a/framework/Http/lib/Horde/Http/Response/Fopen.php +++ b/framework/Http/lib/Horde/Http/Response/Fopen.php @@ -41,9 +41,15 @@ class Horde_Http_Response_Fopen extends Horde_Http_Response_Base */ public function getBody() { + $oldTrackErrors = ini_set('track_errors', 1); $content = @stream_get_contents($this->_stream); + ini_set('track_errors', $oldTrackErrors); if ($content === false) { - throw new Horde_Http_Exception('Problem reading data from ' . $this->uri . ': ' . $php_errormsg); + $msg = 'Problem reading data from ' . $this->uri; + if (isset($php_errormsg)) { + $msg .= ': ' . $php_errormsg; + } + throw new Horde_Http_Exception($msg); } return $content; } -- 2.11.0