rp_report_error (private)
rp_report_error [ -message message ]
Defined in packages/acs-tcl/tcl/request-processor-procs.tcl
Writes an error to the connection.
- Switches:
- -message (optional)
- The message to write (pulled from
$::errorInfo
if none is specified).- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: if { ![info exists message] } { # # We need 'message' to be a copy, because errorInfo will get # overridden by some of the template parsing below. # set message $::errorInfo } set error_url [ad_url][ad_conn url]?[export_vars -entire_form] set error_file [ad_conn file] set prev_url [util::get_referrer -trusted] set feedback_id [db_nextval acs_object_id_seq] set user_id [ad_conn user_id] set bug_package_id [ad_conn package_id] set error_info $message set vars_to_export [export_vars -form { error_url error_info user_id prev_url error_file feedback_id bug_package_id }] if {![ns_conn isconnected]} { ad_log warning "rp_report_error: request handler received error after connection was closed: $message\n$error_url" return } ds_add conn error $message set params [list] #Serve the stacktrace set params [list [list stacktrace $message] [list user_id $user_id] [list error_file $error_file] [list prev_url $prev_url] [list feedback_id $feedback_id] [list error_url $error_url] [list bug_package_id $bug_package_id] [list vars_to_export $vars_to_export]] set error_message $message if {[parameter::get -package_id $::acs::kernel_id -parameter RestrictErrorsToAdminsP -default 0] && ![permission::permission_p -object_id [ad_conn package_id] -privilege admin] } { set message {} #set params [lreplace $params 0 0 [list stacktrace $message]] lset params 0 [list stacktrace $message] } ad_try -auto_abort=false { set rendered_page [ad_parse_template -params $params "/packages/acs-tcl/lib/page-error"] } trap {AD EXCEPTION ad_script_abort} {r} { # # ad_parse_template was script-aborted # ns_log warning "rp_report_error: error template with message '$error_message' aborted" return } on error {errorMsg} { # # An error occurred during rendering of the error page. # ns_log error "rp_report_error: error $errorMsg rendering error page (!)\n$::errorInfo" set rendered_page [subst {</table></table></table></h1></b></i> <blockquote><pre>[ns_quotehtml $error_message]</pre></blockquote> }] } ad_log error $error_message ns_return 500 text/html $rendered_pageXQL Not present: Generic, PostgreSQL, Oracle