diff --git a/app.py b/app.py index 08081eb..06c3fb4 100644 --- a/app.py +++ b/app.py @@ -1654,6 +1654,11 @@ def server_info(id): def page_not_found(error): return render_template("404.html", error=error), 404 +@app.errorhandler(500) +def internal_server_error(error): + if app.debug: + return render_template("500.html", error=error), 500 + scheduler = BackgroundScheduler(timezone=get_localzone()) scheduler.add_job(func=scheduled_deployments, trigger="interval", minutes=1, next_run_time=datetime.now()) scheduler.add_job(func=automated_backups, trigger="interval", minutes=1, next_run_time=datetime.now()) diff --git a/templates/500.html b/templates/500.html new file mode 100644 index 0000000..f74d1b6 --- /dev/null +++ b/templates/500.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} +{% block title %}500 - Błąd serwera{% endblock %} +{% block content %} +
+

500

+

Wewnętrzny błąd serwera. Przepraszamy za niedogodności.

+ {% if error %} +
{{ error }}
+ {% endif %} +
+{% endblock %}