diff options
author | Brion Vibber <brion@pobox.com> | 2010-05-04 17:11:43 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-05-04 17:11:43 -0700 |
commit | 5f5d9518bdc5daec5a9250a852777d3015856c78 (patch) | |
tree | 6e681a2c3cf535fa4f46fd3d5ad98bd89babc3f3 | |
parent | 9d2c3d45bc32f54d325072d67d8426edd0e112f0 (diff) |
Avoid spewing giant debug backtrace into exception in certain OStatus subscription failure cases.
The code pattern 'new XXXException($e)' to chain exceptions doesn't actually work as intended, as exceptions are actually expecting a string message here.
This caused an implicit string conversion from HTTP_Request2_Exception, which is a PEAR_Exception, which defines an absurdly detailed __toString() method including a giant HTML table with a backtrace if you happen to be on a web request.
Simply passing $e->getMessage() instead clears this up, as we'll get the nice short message like 'Couldn't connect to tcp://blahblah:80'
-rw-r--r-- | plugins/OStatus/lib/feeddiscovery.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/OStatus/lib/feeddiscovery.php b/plugins/OStatus/lib/feeddiscovery.php index 4809f9d35..4ac243832 100644 --- a/plugins/OStatus/lib/feeddiscovery.php +++ b/plugins/OStatus/lib/feeddiscovery.php @@ -104,7 +104,7 @@ class FeedDiscovery $response = $client->get($url); } catch (HTTP_Request2_Exception $e) { common_log(LOG_ERR, __METHOD__ . " Failure for $url - " . $e->getMessage()); - throw new FeedSubBadURLException($e); + throw new FeedSubBadURLException($e->getMessage()); } if ($htmlOk) { |