Пример #1
0
 def catch(request, *args, **kwargs):
     try:
         back = func(request, *args, **kwargs)
         return back
     except Exception as e:
         logging.exception(str(e))
         return output.ErrorResponse(msg=str(e))
Пример #2
0
 def get(self, request, *args, **kwargs):
     params = DictToObj(request.params)
     r = add.delay(4, 12)
     result = r.wait()
     logging.info("ok!")
     if not result:
         return output.ErrorResponse(msg="fail,no result", status=500)
     return output.NormalResponse({'detail': result}, status=200)
Пример #3
0
 def post(self, request, *args, **kwargs):
     return output.ErrorResponse(msg="Please give correct path", status=500)