Opened 9 years ago

Closed 9 years ago

#25404 closed Cleanup/optimization (fixed)

Template syntax errors should include line number in their message

Reported by: Dave Smith Owned by: nobody
Component: Template system Version: 1.8
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

I realize the Django debug UI will show line numbers when DEBUG = True, and that's great. But what about when you are writing a test and your code raises an uncaught TemplateSyntaxError? In this case, it would be really nice if the TemplateSyntaxError's message would show the line number directly in the stack trace.

PR: https://github.com/django/django/pull/5268

Change History (2)

comment:1 by Tim Graham, 9 years ago

Easy pickings: unset
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

comment:2 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: newclosed

In b53b4d5:

Fixed #25404 -- Added line numbers to TemplateSyntaxError strings.

This makes it much easier to diagnose a test failure when all
you have is the stack trace from an uncaught TemplateSyntaxError.

Note: See TracTickets for help on using tickets.
Back to Top