1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-20 15:22:17 +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:
logmanoriginal
2016-08-17 14:45:08 +02:00
parent 73a1bcf3d6
commit 74f0572d91
124 changed files with 401 additions and 400 deletions

View File

@@ -6,7 +6,7 @@ class JapanExpoBridge extends BridgeAbstract{
$this->name = 'Japan Expo Actualités';
$this->uri = 'http://www.japan-expo-paris.com/fr/actualites';
$this->description = 'Returns most recent entries from Japan Expo actualités.';
$this->update = '2016-08-09';
$this->update = '2016-08-17';
$this->parameters[] =
'[
{
@@ -59,7 +59,7 @@ class JapanExpoBridge extends BridgeAbstract{
};
$link = 'http://www.japan-expo-paris.com/fr/actualites';
$html = $this->file_get_html($link) or $this->returnError('Could not request JapanExpo: '.$link , 500);
$html = $this->file_get_html($link) or $this->returnServerError('Could not request JapanExpo: '.$link);
$fullcontent = (!empty($param['mode']) && $param['mode'] == 'full');
$count = 0;
@@ -73,7 +73,7 @@ class JapanExpoBridge extends BridgeAbstract{
if ($fullcontent) {
if ($count < 5) {
$article_html = $this->file_get_html($url) or $this->returnError('Could not request JapanExpo: '.$url , 500);
$article_html = $this->file_get_html($url) or $this->returnServerError('Could not request JapanExpo: '.$url);
$header = $article_html->find('header.pageHeadBox', 0);
$timestamp = strtotime($header->find('time', 0)->datetime);
$title_html = $header->find('div.section', 0)->next_sibling();