def render_error(user_message, code=400, with_retry=False):
if request.is_xhr:
xhr_response = {
'error': True
}
if user_message:
xhr_response['message'] = page_formatting(user_message)
return jsonify(xhr_response), code
else:
return render_template('error.html', message=user_message, with_retry=with_retry), code
评论列表
文章目录