Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#3084 closed change (fixed)

[cms] Show full tracebacks for exceptions passing template code

Reported by: sebastian Assignee: sebastian
Priority: P4 Milestone:
Module: Sitescripts Keywords:
Cc: trev, kzar Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by sebastian)


When an exception, is raised in, or passes a jinja template the traceback usually includes the template code. However, when using the CMS the filename is unknown, and therefore the traceback is incomplete. That makes debugging quite difficult.

What to change

Make Source.read_file() return a data structure that contains the data as well as the filename and pass it up to the Converter and template loader. Then make the TemplateConverter pass the filename to jinja2, that exceptions will have a complete and correct traceback.

Additionally, we have to pass the filename to compile() when loading custom template filters and globals. Otherwise the traceback will be incomplete there as well.

Change History (3)

comment:1 Changed 5 years ago by sebastian

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:2 Changed 5 years ago by sebastian

  • Description modified (diff)
  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.