mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 10:04:54 +02:00
bridges: remove redundant "or returnServerError" after getContents/getSimpleHTMLDom/getSimpleHTMLDomCached (#2398)
When fetching website contents, exceptions already raise on fetching error
This commit is contained in:
parent
fc51c6753d
commit
37cb4091d4
201 changed files with 262 additions and 513 deletions
|
@ -15,8 +15,7 @@ class PatreonBridge extends BridgeAbstract {
|
|||
));
|
||||
|
||||
public function collectData(){
|
||||
$html = getSimpleHTMLDOMCached($this->getURI(), 86400)
|
||||
or returnServerError('Failed to load creator page at ' . $this->getURI());
|
||||
$html = getSimpleHTMLDOMCached($this->getURI(), 86400);
|
||||
$regex = '#/api/campaigns/([0-9]+)#';
|
||||
if(preg_match($regex, $html->save(), $matches) > 0) {
|
||||
$campaign_id = $matches[1];
|
||||
|
@ -168,8 +167,7 @@ class PatreonBridge extends BridgeAbstract {
|
|||
))
|
||||
);
|
||||
|
||||
$data = json_decode(getContents($url, $header, $opts))
|
||||
or returnServerError('API request to "' . $url . '" failed.');
|
||||
$data = json_decode(getContents($url, $header, $opts));
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue