Django

Code

Changeset 6584

Show
Ignore:
Timestamp:
10/21/07 12:51:06 (11 months ago)
Author:
mtredinnick
Message:

Fixed #5732 -- Catch all possible errors when importing a URLConf file. This
leads to error messages that contain the name of the problem file (useful when
the problem is part of an include() import).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/urlresolvers.py

    r5681 r6584  
    250250            try: 
    251251                self._urlconf_module = __import__(self.urlconf_name, {}, {}, ['']) 
    252             except ValueError, e: 
    253                 # Invalid urlconf_name, such as "foo.bar." (note trailing period) 
     252            except Exception, e: 
     253                # Either an invalid urlconf_name, such as "foo.bar.", or some 
     254                # kind of problem during the actual import. 
    254255                raise ImproperlyConfigured, "Error while importing URLconf %r: %s" % (self.urlconf_name, e) 
    255256            return self._urlconf_module