Fail_If(Conditional Expression,Error Code, 'Error Message')
Fail_If(Conditional Expression, 'Error Message')
Use the [Fail_If] method. Lasso will immediately halt processing of the current page or [Protect] block and report the error to the user or run any [Handle] methods that are present.
The following code will report an unknown error if the [web_request->param] named 'Required' is empty.
Note: [Action_Param] is a compatibility layer wrapper for [web_request->param]
Code
Fail_If(not string(web_request->param('Required'))->size, -1, 'Unknown Error')
Result
FAILURE: -1 Unknown Error
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Recent Comments