mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-11 11:04:36 +02:00
refactor: rename functions (#4655)
returnClientError => throwClientException returnServerError => throwServerException New convenience function: throwRateLimitException Old functions are kept but deprecated.
This commit is contained in:
@@ -79,7 +79,7 @@ class YouTubeCommunityTabBridge extends BridgeAbstract
|
||||
$this->feedName ??= '';
|
||||
|
||||
if ($this->hasPostsTab($json) === false) {
|
||||
returnServerError('Channel does not have a posts tab');
|
||||
throwServerException('Channel does not have a posts tab');
|
||||
}
|
||||
|
||||
$posts = $this->getPosts($json);
|
||||
@@ -156,13 +156,13 @@ class YouTubeCommunityTabBridge extends BridgeAbstract
|
||||
private function extractJson($html)
|
||||
{
|
||||
if (!preg_match($this->jsonRegex, $html, $parts)) {
|
||||
returnServerError('Failed to extract data from page');
|
||||
throwServerException('Failed to extract data from page');
|
||||
}
|
||||
|
||||
$data = json_decode($parts[1]);
|
||||
|
||||
if ($data === false) {
|
||||
returnServerError('Failed to decode extracted data');
|
||||
throwServerException('Failed to decode extracted data');
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
Reference in New Issue
Block a user