obsluga 500
This commit is contained in:
parent
ef31984144
commit
146e0f5ab2
5
app.py
5
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())
|
||||
|
11
templates/500.html
Normal file
11
templates/500.html
Normal file
@ -0,0 +1,11 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}500 - Błąd serwera{% endblock %}
|
||||
{% block content %}
|
||||
<div class="container text-center mt-5">
|
||||
<h1 class="display-4">500</h1>
|
||||
<p class="lead">Wewnętrzny błąd serwera. Przepraszamy za niedogodności.</p>
|
||||
{% if error %}
|
||||
<pre>{{ error }}</pre>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
x
Reference in New Issue
Block a user