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


::rivet::abort_page (abort code | -aborting)


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.

The argument -aborting causes abort_page to return 1 when the current execution is the outcome of an abort condition. In other words this query is meaningful in code specified as AfterEveryScript to understand if an abort condition took place beforehand.