ay access.  We can catch this in our
Tcl extension by specifying the following in an interface file :
</p>

<div class="code"><pre>
%exception {
  try {
    $action                // Gets substituted by actual function call
  }
  catch (RangeError) {
    Tcl_SetResult(interp, (char *)"Array index out-of-bounds", TCL_STATIC);
    return TCL_ERROR;
  }
}
</pre></div>

<p>
As shown, the exception handling code will be added to every wrapper function.
Since this is somewhat inefficient.  You might consider refi