From e4521bf84695542f9dcaf344361ad54395db0cfd Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sun, 5 Feb 2017 17:48:27 -0500 Subject: [PATCH] Move error handling to shared code --- git/app.py | 18 ------------------ templates/not_found.html | 10 ---------- 2 files changed, 28 deletions(-) delete mode 100644 templates/not_found.html diff --git a/git/app.py b/git/app.py index f8b62f9..ebff97e 100644 --- a/git/app.py +++ b/git/app.py @@ -22,21 +22,3 @@ except: from git.blueprints.cgit import cgit app.register_blueprint(cgit) - -if not app.debug: - @app.errorhandler(500) - def handle_500(e): - # shit - try: - db.rollback() - db.close() - except: - # shit shit - sys.exit(1) - return render_template("internal_error.html"), 500 - -@app.errorhandler(404) -def handle_404(e): - if request.path.startswith("/api"): - return { "errors": [ { "reason": "404 not found" } ] }, 404 - return render_template("not_found.html"), 404 diff --git a/templates/not_found.html b/templates/not_found.html deleted file mode 100644 index 7c773a7..0000000 --- a/templates/not_found.html +++ /dev/null @@ -1,10 +0,0 @@ -{% extends "layout.html" %} -{% block body %} -
-

404 Not Found

-

- Whatever you're looking for, it isn't here. - Index -

-
-{% endblock %} -- 2.38.4