LassoScript Utility
Basics Browse Detail

[Protect] ... [/Protect]

Tag Link [Protect] ... 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

[Protect] ... [/Protect] protects a portion of a page.

If code inside the container throws an error or a [Fail] tag is exected inside the container then the error is not allowed to propagate outside the protected block.

If the [Protect] ... [/Protect] container includes any [Handle] ... [/Handle] tags they will be called when an error is reported within the container or when the container completes.

Note: Custom tags, included files, and libraries are all surrounded by an implicit set of [Protect] ... [/Protect] tags.

Syntax

[Protect]
  ...
[/Protect]

Parameters

No Parameters Required.

Examples

To protect a portion of a page from error reporting:

Use the [Protect] ... [/Protect] tags. Lasso will not allow any error messages to propagate outside of a protect block. The following code fails with an error -1, but this error is not reported to the visitor since it is caught by the protect block.

[Protect]
  [Fail: -1, 'Unknown Error']
[/Protect]