When a non-JSON response is received, instead just raising a useless exception, include the entire response.
git-svn-id: http://test.kernel.org/svn/autotest/trunk@1496 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/frontend/afe/json_rpc/proxy.py b/frontend/afe/json_rpc/proxy.py
index 8412ed6..d33fc96 100644
--- a/frontend/afe/json_rpc/proxy.py
+++ b/frontend/afe/json_rpc/proxy.py
@@ -45,7 +45,10 @@
request = urllib2.Request(self.__serviceURL, data=postdata,
headers=self.__headers)
respdata = urllib2.urlopen(request).read()
- resp = json_decoder.decode(respdata)
+ try:
+ resp = json_decoder.decode(respdata)
+ except ValueError:
+ raise JSONRPCException('Error decoding JSON reponse:\n' + respdata)
if resp['error'] != None:
error_message = (resp['error']['name'] + ': ' +
resp['error']['message'] + '\n' +