Class o2.Try


static class o2.Try

Used for consequentially executing a set of Functions.

The functions are guaranteed to be called.

Even if an error occurs when calling a Function, the next Function will be tried, disregarding the error.

Defined in try.core

Function Summary
static all (Arguments ...)

Executes all the given delegates one by one.

If an exception occurs while executing the argument, the next one will be tried.

Usage example:

 o2.Try.all(fn1, fn2, fn3);
 
static these (Arguments ...)

Tries all the given delegates, will stop at the first successful execution.

If an exception occurs while executing the argument, the next one will be tried.

But after the first successful execution, with no error, no further functions will be executed.

Usage example:

 o2.Try.these(fn1, fn2, fn3);
 

Function Details

function all

static all(Arguments ...)

Executes all the given delegates one by one.

If an exception occurs while executing the argument, the next one will be tried.

Usage example:

 o2.Try.all(fn1, fn2, fn3);
 
Parameters:
... - each argument as a function.

function these

static these(Arguments ...)

Tries all the given delegates, will stop at the first successful execution.

If an exception occurs while executing the argument, the next one will be tried.

But after the first successful execution, with no error, no further functions will be executed.

Usage example:

 o2.Try.these(fn1, fn2, fn3);
 
Parameters:
... - each argument as a function.