aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/due/__init__.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/due/__init__.py b/src/due/__init__.py
index eac39d4..5bbe471 100644
--- a/src/due/__init__.py
+++ b/src/due/__init__.py
@@ -1,5 +1,6 @@
from flask import Flask
from due.routes import auth, oauth, index
+from due.html import page
from flask_cors import CORS
from dotenv import load_dotenv
from due.cache import cache
@@ -16,4 +17,15 @@ app.register_blueprint(oauth.bp, url_prefix="/oauth")
app.register_blueprint(index.bp)
app.secret_key = os.getenv("SECRET_KEY")
+
+def error_handler(e):
+ return page(
+ """<p>You have encountered a critcal application error. This means that one or more media entries on your lists have resolved abnormaly.</p>
+ <p></p>
+ <p>Contact <a href="https://anilist.co/user/fuwn">Fuwn</a> on AniList for help; please, attach the error code below.</p>""",
+ f"<pre>{e}</pre>",
+ )
+
+
cache.init_app(app)