diff --git a/files/routes/errors.py b/files/routes/errors.py index 6f63c2e05..0cb13116f 100644 --- a/files/routes/errors.py +++ b/files/routes/errors.py @@ -85,13 +85,13 @@ def error(e): if WERKZEUG_ERROR_DESCRIPTIONS.get(e.code, None) == details: details = None if request.headers.get("Authorization") or request.headers.get("xhr"): - return {"error": msg, "code": e.code, "details": details} + return {"error": title, "code": e.code, "description": msg, "details": details} img = ERROR_MARSEYS.get(e.code, 'marseyl') return render_template('errors/error.html', err=True, title=title, msg=msg, details=details, img=img), e.code @app.errorhandler(401) def error_401(e): - if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error": "401 Not Authorized"}, 401 + if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error": "401 Unauthorized"}, 401 else: path = request.path qs = urlencode(dict(request.values)) @@ -103,7 +103,8 @@ def error_401(e): @app.errorhandler(500) def error_500(e): g.db.rollback() - return error(e) + if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error": "500 Internal Server Error"}, 500 + else: return render_template('errors/500.html', err=True), 500 @app.post("/allow_nsfw") diff --git a/files/templates/errors/400.html b/files/templates/errors/400.html deleted file mode 100644 index 894d59c7a..000000000 --- a/files/templates/errors/400.html +++ /dev/null @@ -1,20 +0,0 @@ -{% extends "default.html" %} - -{% block title %} -
That request was bad and you should feel bad.
-Someone typed something wrong and it was probably you, please do better.
- -idk how anyone gets this error but if you see this, remember to follow @carpathianflorist
the original error text here talked about internet gremlins and wtf
Please upload only Image, Video, or Audio files!
-go spam somewhere else nerd
-