mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-12 03:24:01 +02:00
bridges: Replace returnError function with more specific
Replacements depend on original error code: 400: returnClientError 404: returnServerError 500: returnServerError 501: returnServerError
This commit is contained in:
@@ -6,7 +6,7 @@ class NakedSecurityBridge extends BridgeAbstract {
|
||||
$this->name = 'Naked Security';
|
||||
$this->uri = 'https://nakedsecurity.sophos.com/';
|
||||
$this->description = 'Returns the newest articles.';
|
||||
$this->update = '2016-08-09';
|
||||
$this->update = '2016-08-17';
|
||||
}
|
||||
|
||||
public function collectData(array $param) {
|
||||
@@ -36,7 +36,7 @@ class NakedSecurityBridge extends BridgeAbstract {
|
||||
}
|
||||
|
||||
$feedUrl = 'https://feeds.feedburner.com/nakedsecurity?format=xml';
|
||||
$html = $this->file_get_html($feedUrl) or $this->returnError('Could not request '.$this->getName().': '.$feedUrl, 500);
|
||||
$html = $this->file_get_html($feedUrl) or $this->returnServerError('Could not request '.$this->getName().': '.$feedUrl);
|
||||
$limit = 0;
|
||||
|
||||
foreach ($html->find('item') as $element) {
|
||||
@@ -44,7 +44,7 @@ class NakedSecurityBridge extends BridgeAbstract {
|
||||
|
||||
//Retrieve article Uri and get that page
|
||||
$article_uri = $element->find('guid', 0)->plaintext;
|
||||
$article_html = $this->file_get_html($article_uri) or $this->returnError('Could not request '.$this->getName().': '.$article_uri, 500);
|
||||
$article_html = $this->file_get_html($article_uri) or $this->returnServerError('Could not request '.$this->getName().': '.$article_uri);
|
||||
|
||||
//Build article contents from corresponding elements
|
||||
$article_title = trim($element->find('title', 0)->plaintext);
|
||||
|
Reference in New Issue
Block a user