LassoScript Utility
Basics Browse Detail

[Handle] ... [/Handle]

Tag Link [Handle] ... Category Error
Type Container Source Available No
Support Preferred Version 5.0
Change Unchanged Data Source Any
Output Type None Security None
Implementation Internal Sets Lasso 8.5, Lasso 8.0, Lasso 7.0, Lasso 6.0, Lasso 5.0

Description

[Handle] ... [/Handle] conditionally executes after the code in the current container tag or format file is completed or a [Fail] tag is called. Takes a conditional expression as a parameter.

Each [Handle] ... [/Handle] container is executed after all other code within the current format file, [Protect] ... [/Protect] block, or custom tag.

Syntax

[HandleConditional Expression]
  ...
[/Handle]

Parameters

Optional Parameters
Conditional Expression The conditional expression which is executed to determine if the contents of the container tag should be executed.

Examples

To perform code if a specific error is reported:

Use the [Handle] ... [/Handle] tags. After a [Fail] tag is called, Lasso will allow each handle block within the current [Protect] ... [/Protect] tags to run. Each [Handle] tag can check the current error message to see whether it should run or not.

The following example performs the code inside the [Handle] ... [/Handle] block if an unknown error occurs.

[Handle: (Error_CurrentError) == 'Unknown Error']
  [Redirect_URL: 'error.lasso']
[/Handle]