Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improved error message in urlresolvers (fixes #240)

git-svn-id: http://code.djangoproject.com/svn/django/trunk@357 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit af95567c1425975353567acba8af6f14a8802276 1 parent 2f04115
Jacob Kaplan-Moss jacobian authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 django/core/urlresolvers.py
6 django/core/urlresolvers.py
View
@@ -38,8 +38,10 @@ def get_callback(self):
mod_name, func_name = get_mod_func(self.callback)
try:
return getattr(__import__(mod_name, '', '', ['']), func_name)
- except (ImportError, AttributeError), e:
- raise ViewDoesNotExist, "Tried %s. Error was: %s" % (self.callback, str(e))
+ except ImportError, e:
+ raise ViewDoesNotExist, "Could not import %s. Error was: %s" % (mod_name, str(e))
+ except AttributeError, e:
+ raise ViewDoesNotExist, "Tried %s in module %s. Error was: %s" % (func_name, mod_name, str(e))
class RegexURLMultiplePattern:
def __init__(self, regex, urlconf_module):
Please sign in to comment.
Something went wrong with that request. Please try again.