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

@ -24,7 +24,7 @@ class CpasbienBridge extends HttpCachingBridgeAbstract{
$this->name = "Cpasbien Bridge";
$this->uri = "http://www.cpasbien.io";
$this->description = "Returns latest torrents from a request query";
$this->update = "2016-08-09";
$this->update = '2016-08-17';
$this->parameters[] =
'[
@ -44,10 +44,10 @@ class CpasbienBridge extends HttpCachingBridgeAbstract{
$html = '';
if (isset($param['q'])) { /* keyword search mode */
$this->request = str_replace(" ","-",trim($param['q']));
$html = $this->file_get_html($this->uri.'/recherche/'.urlencode($this->request).'.html') or $this->returnError('No results for this query.', 404);
$html = $this->file_get_html($this->uri.'/recherche/'.urlencode($this->request).'.html') or $this->returnServerError('No results for this query.');
}
else {
$this->returnError('You must specify a keyword (?q=...).', 400);
$this->returnClientError('You must specify a keyword (?q=...).');
}
foreach ($html->find('#gauche',0)->find('div') as $episode) {