From e7a6ee7e953351394be6d1f25c5dc02ade3689ec Mon Sep 17 00:00:00 2001 From: iAmShorty Date: Wed, 12 Feb 2014 11:03:51 +0100 Subject: [PATCH 1/2] [UPDATE] logging rpc error message --- public/include/lib/jsonRPCClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/include/lib/jsonRPCClient.php b/public/include/lib/jsonRPCClient.php index f25fb0b9..f045492b 100644 --- a/public/include/lib/jsonRPCClient.php +++ b/public/include/lib/jsonRPCClient.php @@ -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']); + 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); From 2d0755915a71539ae0ea9e7cb5eed11194f279bc Mon Sep 17 00:00:00 2001 From: iAmShorty Date: Wed, 12 Feb 2014 11:47:47 +0100 Subject: [PATCH 2/2] [UPDATE] no php notice when array is empty --- public/include/lib/jsonRPCClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/include/lib/jsonRPCClient.php b/public/include/lib/jsonRPCClient.php index f045492b..5c68662d 100644 --- a/public/include/lib/jsonRPCClient.php +++ b/public/include/lib/jsonRPCClient.php @@ -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);