Skip to content

Commit

Permalink
Reraise template-resolution exceptions in development mode
Browse files Browse the repository at this point in the history
In development mode it maybe helpful to reraise TemplateDoesNotExist or
UnicodeEncodeError exception instead of hiding it behind a 404 Not
Found, so it's easier to diagnose the issue.
  • Loading branch information
shunghsiyu committed Jun 14, 2020
1 parent d6fb184 commit 042387b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def resolve_template(self, template):
try:
return super().resolve_template(template)
except (UnicodeEncodeError, TemplateDoesNotExist):
if settings.DEBUG:
raise
raise Http404


Expand Down

0 comments on commit 042387b

Please sign in to comment.