[UPDATE] no php notice when array is empty

This commit is contained in:
iAmShorty 2014-02-12 11:47:47 +01:00
parent e7a6ee7e95
commit 2d0755915a

View File

@ -114,7 +114,7 @@ class jsonRPCClient {
$resultStatus = curl_getinfo($ch);
if ($resultStatus['http_code'] != '200') {
if ($resultStatus['http_code'] == '401') throw new Exception('RPC call did not return 200: Authentication failed');
throw new Exception('RPC call did not return 200: HTTP error: ' . $resultStatus['http_code'] . ' - JSON Response: ' . $response['error']['message']);
throw new Exception('RPC call did not return 200: HTTP error: ' . $resultStatus['http_code'] . ' - JSON Response: ' . @$response['error']['message']);
}
if (curl_errno($ch)) throw new Exception('RPC call failed: ' . curl_error($ch));
curl_close($ch);