示例#1
0
 def wrap(*args, **kwargs):
     try:
         return f(*args, **kwargs)
     except Exception, e:
         se = _serialize_exception(e)
         error = {'code': 200, 'message': "Odoo Server Error", 'data': se}
         return werkzeug.exceptions.InternalServerError(
             simplejson.dumps(error))
示例#2
0
 def wrap(*args, **kwargs):
     try:
         return f(*args, **kwargs)
     except Exception, e:
         _logger.exception("An exception occured during an http request")
         se = _serialize_exception(e)
         error = {'code': 200, 'message': "Odoo Server Error", 'data': se}
         return werkzeug.exceptions.InternalServerError(
             simplejson.dumps(error))
示例#3
0
 def wrap(*args, **kwargs):
     try:
         return f(*args, **kwargs)
     except Exception, e:
         se = _serialize_exception(e)
         error = {
             'code': 200,
             'message': "OpenERP Server Error",
             'data': se
         }
         return werkzeug.exceptions.InternalServerError(simplejson.dumps(error))
示例#4
0
 def wrap(*args, **kwargs):
     try:
         return f(*args, **kwargs)
     except Exception, e:
         _logger.exception("An exception occured during an http request")
         se = _serialize_exception(e)
         error = {
             'code': 200,
             'message': "Odoo Server Error",
             'data': se
         }
         return werkzeug.exceptions.InternalServerError(simplejson.dumps(error))
示例#5
0
 def wrap(*args, **kwargs):
     res = utils.init_response_data()
     try:
         res = f(*args, **kwargs)
         res["message"] = status.Status().getReason(res["code"])
     except Exception, e:
         res["code"] = status.Status.ERROR
         res["message"] = status.Status().getReason(res["code"])
         _logger.exception("An exception occured during an http request")
         se = _serialize_exception(e)
         error = {'code': 200, 'message': "Odoo Server Error", 'data': se}
         res["error_info"] = error
         return simplejson.dumps(res)
示例#6
0
 def wrap(*args, **kwargs):
     res = utils.init_response_data()
     try:
         res = f(*args, **kwargs)
         res["message"] = status.Status().getReason(res["code"])
     except Exception, e:
         res["code"] = status.Status.ERROR
         res["message"] = status.Status().getReason(res["code"])
         _logger.exception("An exception occured during an http request")
         se = _serialize_exception(e)
         error = {'code': 200, 'message': "Odoo Server Error", 'data': se}
         res["error_info"] = error
         response = request.make_response(
             json.dumps(res), headers={"Access-Control-Allow-Origin": "*"})
         return response
示例#7
0
 def wrap(*args, **kwargs):
     res = utils.init_response_data()
     try:
         res = f(*args, **kwargs)
         res["message"] = status.Status().getReason(res["code"])
     except Exception, e:
         res["code"] = status.Status.ERROR
         res["message"] = status.Status().getReason(res["code"])
         _logger.exception("An exception occured during an http request")
         se = _serialize_exception(e)
         error = {
             'code': 200,
             'message': "Odoo Server Error",
             'data': se
         }
         res["error_info"] = error
         return simplejson.dumps(res)