Opened on 09/16/2015 at 11:47:58 AM
Closed on 09/17/2015 at 06:19:38 AM
Last modified on 09/17/2015 at 10:06:45 AM
#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)
Background
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.
Attachments (0)
Change History (3)
comment:1 Changed on 09/16/2015 at 11:48:25 AM by sebastian
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:2 Changed on 09/17/2015 at 06:19:38 AM by sebastian
- Description modified (diff)
- Resolution set to fixed
- Status changed from reviewing to closed
https://hg.adblockplus.org/cms/rev/71c28d6a709c