Name

abort_page — Stops outputing data to web page, similar in purpose to PHP's die command.

Synopsis

abort_page (abort code | -aborting)

Description

This command flushes the output buffer and stops the Tcl script from sending any more data to the client. A normal Tcl script might use the exit command, but that cannot be used in Rivet without actually exiting the apache child process! abort_page triggers the execution of an optional AbortScript that has to be specified in the configuration. The value of the argument ?abort code? can be retrieved with the abort_code command during the execution of AbortScript or AfterEveryScript, allowing the script to take appropriate actions in order to deal with the cause of the abort.

When passed the argument -aborting the command returns 1 if abort_page had been called earlier in the request processing, thus providing a tool for code in AfterEveryScript to tell if the an abort condition took place.