diff --git a/bridges/ImgsedBridge.php b/bridges/ImgsedBridge.php index a9273813..ed541adb 100644 --- a/bridges/ImgsedBridge.php +++ b/bridges/ImgsedBridge.php @@ -59,7 +59,7 @@ class ImgsedBridge extends BridgeAbstract $this->collectTaggeds(); } } catch (HttpException $e) { - throw new \Exception(sprintf('Unable to find user `%s`', $username)); + throwClientException(sprintf('Unable to find user `%s`', $username)); } } diff --git a/bridges/TelegramBridge.php b/bridges/TelegramBridge.php index 0a3f1a74..9518e3f7 100644 --- a/bridges/TelegramBridge.php +++ b/bridges/TelegramBridge.php @@ -61,7 +61,7 @@ class TelegramBridge extends BridgeAbstract $messages = $dom->find('div.tgme_widget_message_wrap.js-widget_message_wrap'); if (!$channelTitle && !$messages) { - throw new \Exception('Unable to find channel. The channel is non-existing or non-public.'); + throwClientException('Unable to find channel. The channel is non-existing or non-public.'); } foreach (array_reverse($messages) as $message) { diff --git a/bridges/TwitchBridge.php b/bridges/TwitchBridge.php index 6605a973..c7df4053 100644 --- a/bridges/TwitchBridge.php +++ b/bridges/TwitchBridge.php @@ -93,7 +93,7 @@ EOD; $response = $this->apiRequest($query, $variables); $data = $response->data; if ($data->user === null) { - throw new \Exception(sprintf('Unable to find channel `%s`', $channel)); + throwClientException(sprintf('Unable to find channel `%s`', $channel)); } $user = $data->user; diff --git a/lib/TwitterClient.php b/lib/TwitterClient.php index f71e842c..c50f8835 100644 --- a/lib/TwitterClient.php +++ b/lib/TwitterClient.php @@ -290,7 +290,7 @@ class TwitterClient $response = Json::decode(getContents($url, $this->createHttpHeaders()), false); if (isset($response->errors)) { // Grab the first error message - throw new \Exception(sprintf('From twitter api: "%s"', $response->errors[0]->message)); + throwClientException(sprintf('From twitter api: "%s"', $response->errors[0]->message)); } $userInfo = $response->data->user; $this->data[$screenName] = $userInfo; @@ -423,7 +423,7 @@ class TwitterClient $response = Json::decode(getContents($url, $this->createHttpHeaders()), false); if (isset($response->errors)) { // Grab the first error message - throw new \Exception(sprintf('From twitter api: "%s"', $response->errors[0]->message)); + throwClientException(sprintf('From twitter api: "%s"', $response->errors[0]->message)); } $listInfo = $response->data->user_by_screen_name->list; $this->data[$screenName . '-' . $listSlug] = $listInfo;