Recently at work, we came across a bug in our error page (ironic, I know). It involves a browser page printing the stacktrace of tcl. The page is supposed to show something like this:
I'm an error
while executing
"error "I'm an error""
("uplevel" body line 13)
invoked from within
"uplevel {
# /packages/my-package/www/form.tcl
ad_page_contract {
@author Stephen Saunders
..."
(procedure "code::tcl::/web/sites/ssaunders/packages/my-package/w..." line 2)
invoked from within
"code::tcl::$__adp_stub"
("uplevel" body line 12)
invoked from within
"uplevel {
However, the trace displayed with the HTML encoding:
hello
while executing
"error "hello""
("uplevel" body line 13)
invoked from within
"uplevel {
# /packages/my-package/www/form.tcl
ad_page_contract {
@author Stephen Saunders
..."
(procedure "code::tcl::/web/sites/ssaunders/packages/my-package/w..." line 2)
invoked from within
"code::tcl::$__adp_stub"
("uplevel" body line 12)
invoked from within
"uplevel {
Really annoying to read. We discovered that the stacktrace was being passed via an include tag to a template.
<include src="wt-error" stacktrace="@stacktrace@" />
Which was then put into an html fragment.
<pre>@stacktrace@</pre>
This meant the stacktrace was getting quoted twice. We solved the issue by adding ;noquote to the include.
So now a question. Is this/should this be expected behavior? It is not documented anywhere that I could find, especially on the include tag reference (https://openacs.org/doc/acs-templating/tagref/include.html), where it would be most important.