|
@@ -7,7 +7,7 @@ from flask import Flask, request, render_template_string
|
|
from flask_sqlalchemy import SQLAlchemy
|
|
from flask_sqlalchemy import SQLAlchemy
|
|
from flask_cors import CORS
|
|
from flask_cors import CORS
|
|
from .constant import error_response
|
|
from .constant import error_response
|
|
-# from .exception import BizException
|
|
|
|
|
|
+from .exception import BizException
|
|
|
|
|
|
db = SQLAlchemy()
|
|
db = SQLAlchemy()
|
|
|
|
|
|
@@ -40,10 +40,10 @@ def create_app():
|
|
app = create_app()
|
|
app = create_app()
|
|
|
|
|
|
|
|
|
|
-# @app.errorhandler(BizException)
|
|
|
|
-# def handle_biz_exception(error):
|
|
|
|
-# traceback.print_exc()
|
|
|
|
-# return error_response(msg=str(error), http_code=200)
|
|
|
|
|
|
+@app.errorhandler(BizException)
|
|
|
|
+def handle_biz_exception(error):
|
|
|
|
+ traceback.print_exc()
|
|
|
|
+ return error_response(msg=str(error), http_code=200)
|
|
|
|
|
|
# Generic error handler for uncaught exceptions
|
|
# Generic error handler for uncaught exceptions
|
|
@app.errorhandler(Exception)
|
|
@app.errorhandler(Exception)
|