Commit bc076e05 authored by MBoretto's avatar MBoretto

Merge remote-tracking branch 'antonio/catchresponseexceptions' into develop

parents ea8cf24a 2762f3ca
...@@ -316,8 +316,13 @@ class Request ...@@ -316,8 +316,13 @@ class Request
return new ServerResponse($fake_response, $bot_name); return new ServerResponse($fake_response, $bot_name);
} }
$response = self::executeCurl($action, $data); $response = json_decode(self::executeCurl($action, $data), true);
return new ServerResponse(json_decode($response, true), $bot_name);
if (is_null($response)) {
throw new TelegramException('Telegram returned an invalid response! Please your bot name and api token.');
}
return new ServerResponse($response, $bot_name);
} }
/** /**
......
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