Skip to content

Commit

Permalink
Prettier error message in default theme (#3729)
Browse files Browse the repository at this point in the history
  • Loading branch information
OzzieIsaacs committed Sep 13, 2020
1 parent 0ca06c2 commit 6e77299
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/pyload/webui/app/handlers.py
Expand Up @@ -18,7 +18,8 @@ def handle_error(exc):

flask.current_app.logger.debug(exc, exc_info=True)

messages = [f"Error {code}: {desc}", tb]
messages = [f"Error {code}: {desc}"]
messages.extend(tb.split('\n'))
return render_template("error.html", messages=messages), code


Expand Down
7 changes: 3 additions & 4 deletions src/pyload/webui/app/templates/base.html
Expand Up @@ -134,6 +134,9 @@

<h1>{% block subtitle %}pyLoad{% endblock %}</h1>

{% block error %}
{% endblock error %}

{% block statusbar %}
{% endblock %}

Expand All @@ -143,10 +146,6 @@ <h1>{% block subtitle %}pyLoad{% endblock %}</h1>
</div>
<noscript><h1>Enable JavaScript to use the webinterface.</h1></noscript>

{% for message in messages %}
<b><p>{{message}}</p></b>
{% endfor %}

<div id="load-indicator" style="opacity: 0; float: right; margin-top: -10px;">
<img src="{{url_for('static', filename='img/ajax-loader.gif')}}" alt="" style="padding-right: 5px"/>
{{_("loading")}}
Expand Down
11 changes: 10 additions & 1 deletion src/pyload/webui/app/templates/error.html
@@ -1,2 +1,11 @@
{% extends 'base.html' %}
{% block title %}{{_("Sorry, something went wrong... :(")}}{% endblock %}
{% block subtitle %}{{_("Sorry, something went wrong... :")}}{% endblock %}
{% block error %}
<div id="body-wrapper">
{% for message in messages %}
<b>
<div style="font-size:12px;">{{message}}</div>
</b>
{% endfor %}
</div>
{% endblock %}

0 comments on commit 6e77299

Please sign in to comment.