コード例 #1
0
 def f():
     try:
         args = self._get_json()
         ret_value = obj_function(*args)
         return self._json_response(ret_value,200)
     except VentureException as e:
         print e
         return self._json_response(e.to_json_object(),500)
     except Exception as e:
         ve = VentureException('fatal',str(e))
         print ve
         return self._json_response(ve.to_json_object(),500)
コード例 #2
0
 def test_to_json_object(self):
     e = VentureException(EXCEPTION, MESSAGE, **DATA)
     self.assertEqual(e.to_json_object(), JSON_EXCEPTION)