SteelArrow supports full exception handling. By supporting exception
handling, error flow control can be completely configured by the developer.
If you are a C++ or Java developer, you will be right at home with this
With exception handling, certain operations can be tried (with TRY), and
any errors that may be generated can be caught (with CATCH). As well,
user information errors can be thrown (with THROW).
The below code snippet shows an example of using TRY/CATCH:
<SATRY> <!--- TRY something --->
INSERT INTO table(col1,col2)
VALUES( '#PARAM.value1#', '#PARAM.value2#' )
There was a database error!<BR>
There was a security error!<BR>
Generated errors that are caught are stored in the ERROR table, and
can be accessed the same way as any other variable. As well, the context of the
error is maintained. This means that the CGI, PARAM or any other
SteelArrow table can be queried to determine its state at the time of the error.
The ERROR table will contain the following:
||Script that generated the error.
||Line number corresponding to the error.
||Type of error; one of the types listed above.
||The data that caused the error to be generated;
usually the corresponding SteelArrow tag.