Skip to content

Commit

Permalink
Merge pull request #2628 from Uninett/redesign-500-page
Browse files Browse the repository at this point in the history
Redesign the 500 error page
  • Loading branch information
podliashanyk committed Jun 1, 2023
2 parents 2d2ef70 + 06fd68d commit ec1c6b1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -40,6 +40,7 @@ found in the [HISTORY](HISTORY) file.
- Handle invalid IP address input in ipdevinfo device searches gracefully, rather then crashing with a 500 error ([#2589](https://github.com/Uninett/nav/issues/2589), [#2590](https://github.com/Uninett/nav/pull/2590))
- Fix broken links to room details from room report for rooms with spaces in their names ([#2592](https://github.com/Uninett/nav/issues/2592), [#2593](https://github.com/Uninett/nav/pull/2593))
- Catch Validation error in filtering of prefixes in API ([#2606](https://github.com/Uninett/nav/issues/2606), [#2608](https://github.com/Uninett/nav/pull/2608))
- Redesign the 500 Error page so that the exception traceback if formatted as one


## [5.6.0] - 2023-01-20
Expand Down
6 changes: 1 addition & 5 deletions python/nav/django/views.py
Expand Up @@ -27,14 +27,10 @@ def custom_500(request):

template = loader.get_template('500.html')

type, value, tb = sys.exc_info()

return HttpResponseServerError(
template.render(
context={
'type': type.__name__,
'value': value,
'traceback': traceback.format_exception(type, value, tb),
'traceback': traceback.format_exc(),
},
request=request,
)
Expand Down
6 changes: 1 addition & 5 deletions python/nav/web/templates/500.html
Expand Up @@ -37,11 +37,7 @@ <h1>Ouch... <i class="fa fa-bug"></i></h1>
<div class="large-12 columns">
<a id="traceback" href="#">View traceback <i id="chevron" class="fa fa-chevron-down"></i></a>
<div class="traceback-info" style="display:none;">
<code>{{ type }}: {{ value }}</p>
{% for line in traceback %}
{{ line }}<br />
{% endfor %}
</code>
<pre>{{ traceback }}</pre>
</div>
</div>
<div class="large-12 columns frontpage-button">
Expand Down

0 comments on commit ec1c6b1

Please sign in to comment.