diff options
author | 2018-02-28 23:33:35 +0000 | |
---|---|---|
committer | 2018-02-28 23:33:35 +0000 | |
commit | c2dfc1bb34e8153bc7372ce6056c6883616ece9b (patch) | |
tree | 0df39f5f8d60d3f528d48347e9a5c8b276875175 /templates | |
parent | reduce memory allocation from 2GB to 512MB (#28) (diff) |
Add error messages (#30)
* Add error messages
Signed-off-by: JoeBanks13 <[email protected]>
* Remove un-used keyword arg from 404
* Assert for status code instead of full content
* PEP8
* test lint
* please coverage
* oh
* Exclude websockets.py from coverage
* Move code output into terminal
* Switch typewriter href protocol
* Add tests for websockets.py
* Abort previous commit, coveralls did not let coverage go down
* Add more pauses and request => response
* move css and js out, add typewriter JS to our own repo & add method for appending text in bulk.
* Enable REPL on 4XX and change error descriptions
* commas
* /error path
Diffstat (limited to 'templates')
-rw-r--r-- | templates/errors/error.html | 59 | ||||
-rw-r--r-- | templates/main/base.html | 4 |
2 files changed, 62 insertions, 1 deletions
diff --git a/templates/errors/error.html b/templates/errors/error.html new file mode 100644 index 00000000..8aa5ff16 --- /dev/null +++ b/templates/errors/error.html @@ -0,0 +1,59 @@ +{% extends 'main/base.html' %} +{% block title %} {{ code }} - Internal server error {% endblock %} +{% block beta_error %}{% endblock %} +{% block content %} + <script> + window._RequestMethod = "{{ request.method.lower() }}"; + window._Code = {{ code }}; + window._ErrorMsg = "{{ error_message }}" + window._Path = "{{ request.path }}" + </script> + <div class="uk-background-muted"> + <div class="uk-section"> + <div class="uk-text-center"><code class="uk-text-large">{{ error_title }}</code></div> + </div> + </div> + <script src="/static/js/typewriter.js"></script> + <link href="/static/css/window.css" rel="stylesheet" type="text/css"/> + <div class="uk-container uk-section"> + <div class="window"> + <div class="top"> + <div class="panel"> + <span class="first"></span> + <span class="second"></span> + <span class="third"></span> + </div> + + <div class="nav"> + <span class="prev active"><i class="fa fa-angle-left"></i></span> + <span class="next"><i class="fa fa-angle-right"></i></span> + + + </div> + + + </div> + + <div class="inside"> + <div class="blok"> + <pre id="terminal"><code style="white-space:pre-wrap;" class="python" id="error"></code></pre> + </div> + </div> + + </div> + </div> + + <style> + #terminal { + background-color: black; + color: white; + } + </style> + + <noscript> + <h1>There was an issue processing your request</h1> + <p>Try again after a while. If the problem persists, open a bug on our <a href="https://github.com/discord-python/site/issues">GitHub issue tracker</a>.</p> + </noscript> + </div> + <script src="/static/js/500.js"></script> +{% endblock %}
\ No newline at end of file diff --git a/templates/main/base.html b/templates/main/base.html index 3da4715e..50281159 100644 --- a/templates/main/base.html +++ b/templates/main/base.html @@ -14,7 +14,8 @@ </head> <body class="page-{{ current_page }}"> {% include "main/navigation.html" %} -{% if current_page != "index" %} +{% if current_page != "index"%} + {% block beta_error %} <div class="uk-container uk-section" style="padding-top: 10px; padding-bottom: 10px;"> <div class="uk-container uk-container-small"> <div class="uk-alert-danger" uk-alert> @@ -25,6 +26,7 @@ </div> </div> </div> + {% endblock %} {% endif %} {% block content %}{% endblock %} </body> |