Skip to content

Commit

Permalink
Merge d313726 into 7d3df46
Browse files Browse the repository at this point in the history
  • Loading branch information
hamidaskarov committed Jun 22, 2019
2 parents 7d3df46 + d313726 commit 934f681
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pygmyui/restclient/error_msg.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import json


INVALID_TOKEN = dict(error="Please log in again to continue.")
INTERNAL_SERVER_ERROR_API = "Something went wrong."
INVALID_TOKEN = dict(error=["Please log in again to continue."])
INTERNAL_SERVER_ERROR_API = ["Something went wrong."]


def API_ERROR(error_message):
Expand All @@ -19,4 +19,4 @@ def API_ERROR(error_message):
import traceback
traceback.print_exc()
error_message = INTERNAL_SERVER_ERROR_API
return dict(error=error_message)
return dict(error=error_message if isinstance(error_message,list) else [error_message])
4 changes: 3 additions & 1 deletion pygmyui/templates/400.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
{% block content %}
<h1 class="vcenter">400</h1><br>
{% if error %}
<h3 class="vcenter">{{error}}</h3>
{%for err in error%}
<h3 class="vcenter">{{err}}</h3>
{%endfor%}
{% else %}
<h3 class="vcenter">Bad Request</h3>
{% endif %}
Expand Down
4 changes: 3 additions & 1 deletion pygmyui/templates/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
{% block content %}
<h1 class="vcenter">404</h1><br>
{% if error %}
<h3 class="vcenter">{{error}}</h3>
{%for err in error%}
<h3 class="vcenter">{{err}}</h3>
{%endfor%}
{% else %}
<h3 class="vcenter">Page Not Found</h3>
{% endif %}
Expand Down
6 changes: 4 additions & 2 deletions pygmyui/templates/500.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
{% block content %}
<h1 class="vcenter">500</h1><br>
{% if error %}
<h3 class="vcenter">{{error}}</h3>
{% else %}
{%for err in error%}
<h3 class="vcenter">{{err}}</h3>
{%endfor%}
{% else %}
<h3 class="vcenter">Something Went Wrong</h3>
{% endif %}
{% endblock content %}

0 comments on commit 934f681

Please sign in to comment.