Ticket #6379: no_exception_hiding.diff
File no_exception_hiding.diff, 1.0 KB (added by , 17 years ago) |
---|
-
django/core/urlresolvers.py
178 178 self._callback = get_callable(self._callback_str) 179 179 except ImportError, e: 180 180 mod_name, _ = get_mod_func(self._callback_str) 181 raise ViewDoesNotExist, "Could not import %s. Error was: %s" % (mod_name, str(e)) 181 msg = str(e) 182 if not msg.endswith(mod_name): 183 raise 184 raise ViewDoesNotExist, "Could not import %s. Error was: %s" % (mod_name, msg) 182 185 except AttributeError, e: 183 186 mod_name, func_name = get_mod_func(self._callback_str) 187 msg = str(e) 188 if not (mod_name in msg and func_name in msg): 189 raise 184 190 raise ViewDoesNotExist, "Tried %s in module %s. Error was: %s" % (func_name, mod_name, str(e)) 185 191 return self._callback 186 192 callback = property(_get_callback)