Permalink
Browse files

Report errors to the screen even if there is a database error

  • Loading branch information...
1 parent e3d3f9a commit 23a2ce327d0970712b616e4f9d3d615b24209392 @william-gr william-gr committed Jun 10, 2013
Showing with 6 additions and 3 deletions.
  1. +6 −3 gui/freeadmin/views.py
View
@@ -174,14 +174,17 @@ def get_traceback_html(self):
def server_error(request, *args, **kwargs):
try:
- adv = Advanced.objects.all().order_by('-id')[0]
- if adv.adv_traceback:
+ tb = Advanced.objects.all().latest('id').adv_traceback
+ except:
+ tb = True
+ try:
+ if tb:
reporter = ExceptionReporter(request, *sys.exc_info())
html = reporter.get_traceback_html()
return HttpResponse(html, mimetype='text/html')
else:
raise
- except:
+ except Exception, e:
return debug.technical_500_response(request, *sys.exc_info())

0 comments on commit 23a2ce3

Please sign in to comment.