1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-13 12:04:09 +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

@@ -108,7 +108,7 @@ class MangaDexBridge extends BridgeAbstract
switch ($this->queriedContext) {
case 'Title Chapters':
preg_match(self::TITLE_REGEX, $this->getInput('url'), $matches)
or returnClientError('Invalid URL Parameter');
or throwClientException('Invalid URL Parameter');
$this->feedURI = self::URI . 'title/' . $matches['uuid'];
$params['order[readableAt]'] = 'desc';
if (!$this->getInput('external')) {
@@ -129,7 +129,7 @@ class MangaDexBridge extends BridgeAbstract
$uri = self::API_ROOT . 'chapter';
break;
default:
returnServerError('Unimplemented Context (getAPI)');
throwServerException('Unimplemented Context (getAPI)');
}
// Remove null keys
@@ -180,7 +180,7 @@ class MangaDexBridge extends BridgeAbstract
if ($content['result'] == 'ok') {
$content = $content['data'];
} else {
returnServerError('Could not retrieve API results');
throwServerException('Could not retrieve API results');
}
switch ($this->queriedContext) {
@@ -191,7 +191,7 @@ class MangaDexBridge extends BridgeAbstract
$this->getChapters($content);
break;
default:
returnServerError('Unimplemented Context (collectData)');
throwServerException('Unimplemented Context (collectData)');
}
}
@@ -257,7 +257,7 @@ class MangaDexBridge extends BridgeAbstract
$header = [ 'Content-Type: application/json' ];
$pages = json_decode(getContents($api_uri, $header), true);
if ($pages['result'] != 'ok') {
returnServerError('Could not retrieve API results');
throwServerException('Could not retrieve API results');
}
if ($this->getInput('images') == 'saver') {