blob: 400c87c5cccc10912ef8a1673a31b86b5581a123 [file] [log] [blame]
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>catch</title><link rel="stylesheet" type="text/css" href="rivet.css"><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"><link rel="home" href="index.html" title="Apache Rivet 3.2"><link rel="up" href="commands.html" title="Rivet Tcl Commands and Variables"><link rel="prev" href="apache_table.html" title="apache_table"><link rel="next" href="clock_to_rfc.html" title="clock_to_rfc850_gmt"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">catch</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="apache_table.html"><img src="images/prev.png" alt="Prev"></a> </td><th width="60%" align="center">Rivet Tcl Commands and Variables</th><td width="20%" align="right"> <a accesskey="n" href="clock_to_rfc.html"><img src="images/next.png" alt="Next"></a></td></tr></table></div><div class="refentry"><div class="refentry.separator"><hr></div><a name="catch"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>catch — wraps core command <span style="font-family:monospace"><span class="command"><strong>catch</strong></span></span> </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis" style="width:80%"><div style="border: 1px solid #282; margin:1ex ; padding:.4ex; padding-left: 0.8ex; word-spacing:1ex "><span style="font-weight:bold ; font-family:monospace">::rivet::catch</span> ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>script</code></em></span>? ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>error_code_var_name</code></em></span>? ?<span style="font-family:monospace; font-weight: bold;"><em class="replaceable"><code>options_var_name</code></em></span>?</div></div></div><div class="refsect1"><a name="idm988"></a><h2>Description</h2><p style="width:90%">
<span style="font-family:monospace"><span class="command"><strong>::rivet::catch</strong></span></span> wraps the core language <span style="font-family:monospace"><span class="command"><strong>catch</strong></span></span>
command adding some extra error handling needed by mod_rivet design.
The rationale for Rivet to have its own <span style="font-family:monospace"><span class="command"><strong>::rivet::catch</strong></span></span> reads
as follows: within mod_rivet a script execution can be interrupted by either calling
<span style="font-family:monospace"><span class="command"><strong>::rivet::exit</strong></span></span>(deprecated) or <span style="font-family:monospace"><span class="command"><strong>::rivet::abort_page</strong></span></span>.
These commands implement a simple internal exception mechanism by
returning a special error code so that execution is in turn handed down to the
<span style="font-family:monospace"><span class="command"><strong>AbortScript</strong></span></span> and eventually to <span style="font-family:monospace"><span class="command"><strong>AfterEveryScript</strong></span></span>
(if any of them is defined). Any code calling one of these commands which runs under
control of the <span style="font-family:monospace"><span class="command"><strong>::catch</strong></span></span> command would need to do this chore itself,
checking the error info and in case throw the error again if it had been originated
by one of mod_rivet's exceptions calls. This is what <span style="font-family:monospace"><span class="command"><strong>::rivet::catch</strong></span></span>
does hiding the implementation details provide a better and more compatibile way to
handle this condition.
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top">
This command is not meant to replace the core command, thus it's not exported from the
<span style="font-family:monospace"><span class="command"><strong>::rivet</strong></span></span> namespace and therefore has to be fully qualified.
</td></tr></table></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="apache_table.html"><img src="images/prev.png" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="commands.html"><img src="images/up.png" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="clock_to_rfc.html"><img src="images/next.png" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">apache_table </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="images/home.png" alt="Home"></a></td><td width="40%" align="right" valign="top"> clock_to_rfc850_gmt</td></tr></table></div></body></html>