mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Improved ViewDoesNotExist error messages in django.core.urlresolvers
git-svn-id: http://code.djangoproject.com/svn/django/trunk@193 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
73ea27ccb0
commit
3ab5791383
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user