##// END OF EJS Templates
fixed RPC call for api that was missing request id
marcink -
r1796:6274adc0 beta
parent child Browse files
Show More
@@ -4,7 +4,7
4 ~~~~~~~~~~~~~~~~~~~~~~~~~
4 ~~~~~~~~~~~~~~~~~~~~~~~~~
5
5
6 JSON RPC controller
6 JSON RPC controller
7
7
8 :created_on: Aug 20, 2011
8 :created_on: Aug 20, 2011
9 :author: marcink
9 :author: marcink
10 :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
10 :copyright: (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
@@ -226,15 +226,20 class JSONRPCController(WSGIController):
226 if self._error is not None:
226 if self._error is not None:
227 raw_response = None
227 raw_response = None
228
228
229 response = dict(id=self._req_id, result=raw_response,
229 response = dict(id=self._req_id, result=raw_response,
230 error=self._error)
230 error=self._error)
231
231
232 try:
232 try:
233 return json.dumps(response)
233 return json.dumps(response)
234 except TypeError, e:
234 except TypeError, e:
235 log.debug('Error encoding response: %s', e)
235 log.debug('Error encoding response: %s', e)
236 return json.dumps(dict(result=None,
236 return json.dumps(
237 error="Error encoding response"))
237 dict(
238 self._req_id,
239 result=None,
240 error="Error encoding response"
241 )
242 )
238
243
239 def _find_method(self):
244 def _find_method(self):
240 """
245 """
General Comments 0
You need to be logged in to leave comments. Login now