From 3ab579138375bd41bd8fca1126b68aecb68b9951 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Tue, 19 Jul 2005 04:30:23 +0000 Subject: [PATCH] Improved ViewDoesNotExist error messages in django.core.urlresolvers git-svn-id: http://code.djangoproject.com/svn/django/trunk@193 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/urlresolvers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/django/core/urlresolvers.py b/django/core/urlresolvers.py index 469790ddd9..2b220a2bd6 100644 --- a/django/core/urlresolvers.py +++ b/django/core/urlresolvers.py @@ -38,8 +38,8 @@ class RegexURLPattern: mod_name, func_name = get_mod_func(self.callback) try: return getattr(__import__(mod_name, '', '', ['']), func_name) - except (ImportError, AttributeError): - raise ViewDoesNotExist, self.callback + except (ImportError, AttributeError), e: + raise ViewDoesNotExist, "Tried %s. Error was: %s" % (self.callback, str(e)) class RegexURLMultiplePattern: def __init__(self, regex, urlconf_module): @@ -92,5 +92,5 @@ class Error404Resolver: mod_name, func_name = get_mod_func(self.callback) try: return getattr(__import__(mod_name, '', '', ['']), func_name), {} - except (ImportError, AttributeError): - raise ViewDoesNotExist, self.callback + except (ImportError, AttributeError), e: + raise ViewDoesNotExist, "Tried %s. Error was: %s" % (self.callback, str(e))