Skip to content

Commit

Permalink
Merge pull request #894 from eric-wieser/safe-error-page
Browse files Browse the repository at this point in the history
Handle unprintable errors in default error template
  • Loading branch information
defnull committed Sep 24, 2016
2 parents d1e3168 + 83cfe03 commit c7ea639
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bottle.py
Original file line number Diff line number Diff line change
Expand Up @@ -4097,7 +4097,12 @@ def wrapper(*args, **kwargs):
<pre>{{e.body}}</pre>
%%if DEBUG and e.exception:
<h2>Exception:</h2>
<pre>{{repr(e.exception)}}</pre>
%%try:
%%exc = repr(e.exception)
%%except:
%%exc = '<unprintable %%s object>' %% type(e.exception).__name__
%%end
<pre>{{exc}}</pre>
%%end
%%if DEBUG and e.traceback:
<h2>Traceback:</h2>
Expand Down

0 comments on commit c7ea639

Please sign in to comment.