1
0
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:
Dag
2025-08-05 20:44:40 +02:00
committed by GitHub
parent b39964cee3
commit f11571ae78
90 changed files with 279 additions and 255 deletions

View File

@@ -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;