Lasso Soft Inc. > Home

[ handle_failure ]

Method

The [handle_failure] container executes it's nested code upon a fail condition of the parent [protect] code block.

All [handle] and [handle_failure] containers must immediately follow the start of the parent [protect] block. This is a change from previous versions of Lasso and increases the reliability of executing fault-condition fallbacks.

  • Syntax
protect => {
	handle_failure => { ... code to execute on failure ... }
	...
}
Examples
  • Beginner

To log the failure of an include:

Use the [handle_failure] method.

Code

protect => {
	handle_failure => {
		log_critical('babyRhinos.lasso include error')
	}
	include('babyRhinos.lasso')
}

Result

In console or log book:
[2011-06-07 09:12:35] babyRhinos.lasso include error

Recent Comments

No Comments found

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. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft