ning the 
exception handler to only apply to specific methods like this:
</p>

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

%exception setitem {
  try {
    $action
  }
  catch (RangeError) {
    Tcl_SetResult(interp, (char *)"Array index out-of-bounds", TCL_STATIC);
    return TCL_ERROR;
  }
}
</pre>
</div>

<p>
In this case, the exception handler is only 