We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 5f5d9518 authored by Brion Vibber's avatar Brion Vibber

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'
parent 9d2c3d45
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment