diff --git a/app/__init__.py b/app/__init__.py index deb9ed6..6ed6ea4 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -22,19 +22,17 @@ def create_app(): # import oracledb # oracledb.init_oracle_client(lib_dir=None) + app = Flask(__name__) + + # Load configuration + app.config.from_object(Config) + + CORS(app) + JWTManager(app) + CORS(app, supports_credentials=True) + try: - - app = Flask(__name__) - - # Load configuration - app.config.from_object(Config) - - CORS(app) - - JWTManager(app) - CORS(app, supports_credentials=True) - # Swagger Doc SWAGGER_URL = app.config.get("SWAGGER_URL") API_URL = app.config.get("API_URL") @@ -45,6 +43,11 @@ def create_app(): swagger_ui_blueprint = get_swaggerui_blueprint(SWAGGER_URL, API_URL) app.register_blueprint(swagger_ui_blueprint, url_prefix=SWAGGER_URL) + except Exception as e: + print(f"Swagger Unexpected error occurred: {e}") + + + try: # Error Handlers register_error_handlers(app)