mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-28 10:30:12 +02:00
feat: embed response in http exception (#3847)
This commit is contained in:
@@ -33,7 +33,15 @@ class GettrBridge extends BridgeAbstract
|
||||
$user,
|
||||
min($this->getInput('limit'), 20)
|
||||
);
|
||||
$data = json_decode(getContents($api), false);
|
||||
try {
|
||||
$json = getContents($api);
|
||||
} catch (HttpException $e) {
|
||||
if ($e->getCode() === 400 && str_contains($e->response->getBody(), 'E_USER_NOTFOUND')) {
|
||||
throw new \Exception('User not found: ' . $user);
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
$data = json_decode($json, false);
|
||||
|
||||
foreach ($data->result->aux->post as $post) {
|
||||
$this->items[] = [
|
||||
|
Reference in New Issue
Block a user