Django

Code

Changeset 8272

Show
Ignore:
Timestamp:
08/09/08 13:06:51 (4 months ago)
Author:
lukeplant
Message:

Made NoReverseMatch? exceptions more helpful. Thanks, mrts

Files:

Legend:

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

    r8015 r8272  
    286286            lookup_view = get_callable(lookup_view, True) 
    287287        except (ImportError, AttributeError): 
    288             raise NoReverseMatch 
     288            raise NoReverseMatch("'%s' is not a callable." % lookup_view) 
    289289        if lookup_view in self.reverse_dict: 
    290290            return u''.join([reverse_helper(part.regex, *args, **kwargs) for part in self.reverse_dict[lookup_view]]) 
    291         raise NoReverseMatch 
     291        raise NoReverseMatch("Reverse for '%s' not found." % lookup_view) 
    292292 
    293293    def reverse_helper(self, lookup_view, *args, **kwargs):