Ticket #19827: #19827-stacktrace_on_reraise.diff
File #19827-stacktrace_on_reraise.diff, 1.1 KB (added by , 12 years ago) |
---|
-
django/template/defaulttags.py
class URLNode(Node): 409 408 url = '' 410 409 try: 411 410 url = reverse(view_name, args=args, kwargs=kwargs, current_app=context.current_app) 412 except NoReverseMatch , e:411 except NoReverseMatch: 413 412 if settings.SETTINGS_MODULE: 413 exc_info = sys.exc_info() 414 414 project_name = settings.SETTINGS_MODULE.split('.')[0] 415 415 try: 416 416 url = reverse(project_name + '.' + view_name, … … class URLNode(Node): 421 421 # Re-raise the original exception, not the one with 422 422 # the path relative to the project. This makes a 423 423 # better error message. 424 raise e 424 raise exc_info[0], exc_info[1], exc_info[2] 425 425 else: 426 426 if self.asvar is None: 427 raise e427 raise 428 428 429 429 if self.asvar: 430 430 context[self.asvar] = url