$WBERR - simulates an error

Availability
$WBERR is available for use with all WBSP commands.

Syntax
$WBERR{errnum|errmsg}
$WBERR[errnum|errmsg]

Parameters
errnum - error number in range from 6000 to 65535
errmsg - optional parameter containing textual description of an error. It should not be omitted if custom error message is not defined in ErrorMessages section of the current WBSP file or in include files.


Returns
Nothing.
When processing this function WhizBase will generate an error with specified number, and process it as any other error (stop the page processing and return an error report, or perform an error redirection).

Example

[FormFields]
WB_BaseName=biblioA.mdb
WB_AllowMultipart=T
WB_Command=A
WB_Redirect=$wbe[http_referer]$wbif[$wbindof[$wbe[http_referer]|?]>0||?wb_startrec=$wbv[sr]]
WB_RcdSet=Titles
wb_UserData=$wbif{$wbindof{$wbgv{system.cfg|AppGroups|$wbe{remote_addr}}|;add record;}>0||$wberr{6001|Sorry!, you do not have the access rights!}}
[Upload]
WB_Disallow=![jpg,gif]
WB_UploadDir=images/
WB_Overwrite=T
WB_MaxFSize=24576
WB_UploadLog=upload.log
 

After running this example (together with titleslist.wbsp), any access to this file from IP address other than 127.0.0.1 will generate an error message:

Error in /wbsp/basic/titlesAdd.wbsp

The following internal error has occurred:
Sorry!, you do not have the access rights!
Error Number = 6001
Please note what you were doing when this problem occurred, so we can identify and correct it. Write down the Web page you were using, any data you may have entered into a form or search box, and anything else that may help us duplicate the problem. Then contact the administrator of this service:
<webmaster@officeserver>