From d66de2a46797f826edd75c7248fc33ba266bf401 Mon Sep 17 00:00:00 2001 From: Andrean Franc Date: Fri, 23 Oct 2015 14:41:30 +0200 Subject: [PATCH] Fix unhelpful None error message when templates are not found --- librarian_core/contrib/system/routes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/librarian_core/contrib/system/routes.py b/librarian_core/contrib/system/routes.py index a257a96..1dc4171 100644 --- a/librarian_core/contrib/system/routes.py +++ b/librarian_core/contrib/system/routes.py @@ -36,12 +36,13 @@ def error_404(exc): @view('errors/500') def error_500(exc): + traceback = exc.traceback or exc.body logging.error("Unhandled error '%s' at %s %s:\n\n%s", exc.exception, request.method.upper(), request.path, - exc.traceback) - return dict(trace=exc.traceback) + traceback) + return dict(trace=traceback) @view('errors/503')