def default_error_handler(req, resp, e):
resp.body = json.dumps({'title': str(type(e)), 'description': str(e)}, indent=2, ensure_ascii=False)
resp.status = falcon.HTTP_500
resp.content_type = 'application/json'
# def http_not_found_handler(req, resp, e):
# resp.body = e.title
# resp.status = e.status
# resp.content_type = 'application/json'
#
#
# def http_missing_param_handler(req, resp, e):
# resp.body = json.dumps({'error': e.title + ':' + ' '.join([p for p in e.args])})
# resp.status = e.status
# resp.content_type = 'application/json'
#
#
# def http_invalid_param_handler(req, resp, e):
# resp.body = json.dumps({'error': e.title + ':' + ' '.join([p for p in e.args])})
# resp.status = e.status
# resp.content_type = 'application/json'
评论列表
文章目录