Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Improved ViewDoesNotExist error messages in django.core.urlresolvers

git-svn-id: http://code.djangoproject.com/svn/django/trunk@193 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 3ab579138375bd41bd8fca1126b68aecb68b9951 1 parent 73ea27c
@adrianholovaty adrianholovaty authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 django/core/urlresolvers.py
View
8 django/core/urlresolvers.py
@@ -38,8 +38,8 @@ def get_callback(self):
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 @@ def resolve(self):
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))
Please sign in to comment.
Something went wrong with that request. Please try again.