A free, self-hostable news aggregator…
Better error message for inaccessible feeds
Alexandre Alapetite56ac35095a69
diff --git a/lib/SimplePie/SimplePie.php b/lib/SimplePie/SimplePie.phpindex 84001dd9a..dc4bbb6cb 100644--- a/lib/SimplePie/SimplePie.php+++ b/lib/SimplePie/SimplePie.php@@ -1582,13 +1582,15 @@ class SimplePieif (!$locate->is_feed($file)){+ $copyStatusCode = $file->status_code; //FreshRSS+ $copyContentType = $file->headers['content-type']; //FreshRSS// We need to unset this so that if SimplePie::set_file() has been called that object is untouchedunset($file);try{if (!($file = $locate->find($this->autodiscovery, $this->all_discovered_feeds))){- $this->error = "A feed could not be found at $this->feed_url. A feed with an invalid mime type may fall victim to this error, or " . SIMPLEPIE_NAME . " was unable to auto-discover it.. Use force_feed() if you are certain this URL is a real feed.";+ $this->error = "A feed could not be found at `$this->feed_url`; the status code is `$copyStatusCode` and content-type is `$copyContentType`"; //FreshRSS$this->registry->call('Misc', 'error', array($this->error, E_USER_NOTICE, __FILE__, __LINE__));return false;}