added empty response error handling

This commit is contained in:
Quentin Pleplé
2011-07-13 16:40:13 -07:00
parent 1dd7264e9b
commit 5e9b7d67b6
2 changed files with 4 additions and 0 deletions

View File

@@ -17,6 +17,9 @@ class HttpClient {
UrlUtils::prepareRequest($url, $parameters, ($httpMethod != HttpMethod::GET) ? true : false);
$response = self::execRequest($httpMethod, $url, $parameters);
if (empty($response)) {
throw new MashapeClientException(EXCEPTION_EMPTY_RESPONSE, EXCEPTION_SYSTEM_ERROR_CODE);
}
$jsonResponse = json_decode($response);
if (empty($jsonResponse)) {