rp_invoke_filter (private)
rp_invoke_filter why filter_info
Defined in packages/acs-tcl/tcl/request-processor-procs.tcl
Invokes the filter described in $argv, writing an error message to the browser if it fails (unless kind is
trace
).
- Parameters:
- why (required)
- filter_info (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set startclicks [clock clicks -microseconds] lassign $filter_info filter_index debug_p arg_count proc arg rp_debug -debug $debug_p "Invoking $why filter $proc" #ns_log notice "RP_INVOKE_FILTER " filter_info <$filter_info> why <$why> proc <$proc> arg_count $arg_count switch -- $arg_count { 0 { set cmd $proc } 1 { set cmd [list $proc $why ] } default { set cmd [list $proc $arg $why ] } } set errno 0 ad_try -auto_abort=false { {*}$cmd } trap {AD EXCEPTION ad_script_abort} {r} { # # no need to propagate the exception # set result filter_return } on error {errMsg} { set errno 1 } on ok {r} { set result $r } if { $errno == 1 } { # Uh-oh - an error occurred. ds_add rp [list filter [list $why [ns_conn method] [ns_conn url] $proc $arg] $startclicks [clock clicks -microseconds] "error" $::errorInfo] # make sure you report catching the error! set error_msg "result $errMsg filter $proc for [ns_conn request] errorInfo is $::errorInfo" rp_debug $error_msg ns_log error "rp_invoke_filter: $error_msg" rp_report_error set result filter_return } elseif {$result ni {"filter_ok" "filter_break" "filter_return"} } { set error_msg "error in filter $proc for [ns_conn request]. Filter returned invalid result \"$result\"" ds_add rp [list filter [list $why [ns_conn method] [ns_conn url] $proc $arg] $startclicks [clock clicks -microseconds] "error" $error_msg] # report the bad filter_return message rp_debug -debug t -ns_log_level error $error_msg rp_report_error -message $error_msg ns_log error "rp_invoke_filter: $error_msg" set result filter_return } else { ds_add rp [list filter [list $why [ns_conn method] [ns_conn url] $proc $arg] $startclicks [clock clicks -microseconds] $result] } rp_debug -debug $debug_p "Done invoking $why filter $proc (returning $result)" return $resultXQL Not present: Generic, PostgreSQL, Oracle