Index: openacs-4/packages/acs-templating/tcl/acs-integration-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/acs-integration-procs.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/acs-templating/tcl/acs-integration-procs.tcl 9 May 2001 05:15:58 -0000 1.2 +++ openacs-4/packages/acs-templating/tcl/acs-integration-procs.tcl 2 Mar 2002 18:26:26 -0000 1.3 @@ -35,8 +35,38 @@ uplevel 1 "ad_return_template $file_stub" } +ad_proc -public ad_return_exception_template { + {-status 500} + {-params ""} + template +} { + Return an exception template and abort the current script. + @param status The HTTP status to return, by default HTTP 500 (Error) + @param params The parameters to pass to the template. + @param template The template file. + Example: + + ad_return_exception_template -params {errmsg {custom_message "My Message"}} + +} { + set template_params [list] + foreach param $params { + switch [llength $param] { + 1 { lappend template_params "&" + lappend template_params [lindex $param 0] + } + 2 { lappend template_params [lindex $param 0] + lappend template_params [lindex $param 1] + } + default { return -code error "Error in parameter list" } + } + } + ns_return $status text/html [template::adp_parse [template::util::url_to_file $template [ad_conn file]] $template_params] + ad_script_abort +} + # Get the server root directory (supposing we run under ACS) ad_proc -public get_server_root {} { file dir [ns_info tcllib]