From c81887024ab6c0da3c9304f649ad8d6fbbd7b06e Mon Sep 17 00:00:00 2001 From: Ayo Ayco Date: Sat, 18 May 2024 22:35:41 +0200 Subject: [PATCH] feat: show warning if threads blueprint is missing --- web.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/web.py b/web.py index 163c542..3637ee0 100755 --- a/web.py +++ b/web.py @@ -2,10 +2,15 @@ from flask import Flask, send_from_directory from flask_caching import Cache import sentry_sdk import json -from threads.threads import threads app = Flask(__name__) -app.register_blueprint(threads, url_prefix='/threads') + +try: + from threads.threads import threads + app.register_blueprint(threads, url_prefix='/threads') +except ImportError: + print(' ! threads blueprint missing') + app.config.from_file("config.json", load=json.load) # caching