Commit fade1d16 authored by Jack'lul's avatar Jack'lul

Log raw body to debug log when response is invalid

parent d73fe239
......@@ -458,10 +458,12 @@ class Request
self::limitTelegramRequests($action, $data);
$response = json_decode(self::execute($action, $data), true);
$raw_response = self::execute($action, $data);
$response = json_decode($raw_response, true);
if (null === $response) {
throw new TelegramException('Telegram returned an invalid response! Please review your bot name and API key.');
TelegramLog::debug($raw_response);
throw new TelegramException('Telegram returned an invalid response!');
}
$response = new ServerResponse($response, $bot_username);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment