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))
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))
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))
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))
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)
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
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)