Browse Source

Better error message for inaccessible feeds

https://github.com/FreshRSS/FreshRSS/issues/456
Alexandre Alapetite 11 years ago
parent
commit
56ac35095a
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lib/SimplePie/SimplePie.php

+ 3 - 1
lib/SimplePie/SimplePie.php

@@ -1582,13 +1582,15 @@ class SimplePie
 
 			if (!$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 untouched
 				unset($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;
 					}