1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-21 07:42:10 +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

@@ -9,7 +9,7 @@ class BandcampBridge extends BridgeAbstract{
$this->name = "Bandcamp Tag";
$this->uri = "http://bandcamp.com/";
$this->description = "New bandcamp release by tag";
$this->update = "2016-08-09";
$this->update = '2016-08-17';
$this->parameters[] =
'[
@@ -26,10 +26,10 @@ class BandcampBridge extends BridgeAbstract{
$html = '';
if (isset($param['tag'])) {
$this->request = $param['tag'];
$html = $this->file_get_html('http://bandcamp.com/tag/'.urlencode($this->request).'?sort_field=date') or $this->returnError('No results for this query.', 404);
$html = $this->file_get_html('http://bandcamp.com/tag/'.urlencode($this->request).'?sort_field=date') or $this->returnServerError('No results for this query.');
}
else {
$this->returnError('You must specify tag (/tag/...)', 400);
$this->returnClientError('You must specify tag (/tag/...)');
}
foreach($html->find('li.item') as $release) {