error . utils . sncode
VERSIONlatest
Generate an error and stop execution.
ERROR
NAME
error - Generates an error and stop execution.
SYNOPSIS
error([code:integer], "Error message as a string");
DESCRIPTION
This function generates an error.
EXAMPLES
Note: In the followings examples, the _ between the { should be removed to make it work.
res={_{error("Wow an error"); }}. return Wow an error.*
res={_{error(code:234,"Wow an error"); }}. return errcode=234
<html>
<body>
<h1>test error</h1>
{_{
a = cgidata();
a;
a.code;
if a.code != undefined then
error(code:a.code,a.error);
endif
}}
</body>
</html>
test error
{_{ a = cgidata(); a; a.code; if a.code != undefined then error(code:a.code,a.error); endif }}
AUTHOR
Written by Pierre Laplante and Caroline Laplante, <laplante@sednove.com>