Forum OpenACS Q&A: Show errors on screen

Collapse
Posted by David Walker on
I have replaced ns_sourceproc on my machines with the following so that I may view the error on screen as I am troubleshooting.
proc ns_sourceproc {conn ignored} {
        set script [ns_url2file [ns_conn url $conn]]
        if ![file exists $script] {
                ns_returnnotfound $conn
        } else {
                if {[string compare [ad_parameter_real dev_server 
special_parameters] "true"] == 0 } {
                        if {[catch {
                                source $script
                        } ] } {
                                variable errorInfo
                                ns_returnerror 500 "
[ns_quotehtml $errorInfo]
" } } else { source $script } } }

it is a accompanied by this in the config.tcl file
ns_section "ns/server/${server}/acs/special_parameters"
    ns_param dev_server true
Collapse
Posted by Claudio Pasolini on
David,
I tried your solution, but I got an Error: invalid command name "ad_parameter_real" running ns_sourceproc.
Any advice?
Collapse
Posted by David Walker on
ad_parameter_real should be ad_parameter.
Collapse
Posted by Claudio Pasolini on

David,
I made the correction, but actually errors are not shown on the browser's screen, nor in the error log!

Any ideas?

Collapse
Posted by hafeez bana on
Look at the patches under http://www.openacs.org/new-file-storage for backport of ad_page_contract. These implement changes to ad-abstract-url that outputs errors to browser as well as working with ad_page_contract (which is one awesome proc in my opinion)

Cheers, Hafeez

Collapse
Posted by David Walker on
This only affects files referenced by their full name. It does not do anything to files accessed by abstract_url. i.e. /index.tcl rather than / and myfile.tcl rather than myfile.

Beyond that I can't think of any reason it shouldn't work.