Commit 308d451f authored by MBoretto's avatar MBoretto

curl handler always closed correctly

parent b2ad7c67
......@@ -222,6 +222,8 @@ class Request
self::log($result);
}
curl_close($ch);
if ($result === false) {
throw new TelegramException(curl_error($ch), curl_errno($ch));
}
......@@ -229,7 +231,6 @@ class Request
throw new TelegramException('Empty server response');
}
curl_close($ch);
return $result;
}
......
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