Browse Source

flask_app: 异常返回

Signed-off-by: binren <zhangbr@elab-plus.com>
binren 5 years ago
parent
commit
f3139ecdf3
1 changed files with 5 additions and 2 deletions
  1. 5 2
      flask_app.py

+ 5 - 2
flask_app.py

@@ -215,8 +215,11 @@ def update_other_city():
 
 @app.route('/report_test', methods=['GET', 'POST'])
 def report_test():
-    reprt_push = ReportPush('bi_report')
-    result = reprt_push.report_data_query(2)
+    try:
+        reprt_push = ReportPush('bi_report')
+        result = reprt_push.report_data_query(2)
+    except Exception as e:
+        return str(e)
     return json.dumps(result, ensure_ascii=False)