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:
logmanoriginal 2016-08-17 14:45:08 +02:00
parent 73a1bcf3d6
commit 74f0572d91
124 changed files with 401 additions and 400 deletions

View file

@ -7,7 +7,7 @@ class Rue89Bridge extends BridgeAbstract{
$this->name = "Rue89";
$this->uri = "http://rue89.nouvelobs.com/";
$this->description = "Returns the 5 newest posts from Rue89 (full text)";
$this->update = "2016-08-09";
$this->update = '2016-08-17';
}
@ -22,7 +22,7 @@ class Rue89Bridge extends BridgeAbstract{
public function collectData(array $param){
$html = $this->file_get_html('http://api.rue89.nouvelobs.com/feed') or $this->returnError('Could not request Rue89.', 404);
$html = $this->file_get_html('http://api.rue89.nouvelobs.com/feed') or $this->returnServerError('Could not request Rue89.');
$limit = 0;
foreach($html->find('item') as $element) {