Scripting reference · Nerdamer Language

iferror

Evaluates a fallback expression only when the first expression throws an ordinary error.

The first argument is deferred. If it succeeds, its value is returned and the fallback is not evaluated. Parser control-flow signals such as return, break, and continue are not treated as ordinary errors.

Examples

These examples use Nerdamer Scripting.

Do not evaluate the fallback when the first expression succeeds.

iferror(5,0/0)
// → 5

Evaluate the fallback after an error.

iferror(0/0,7)
// → 7

Interfaces

The same operation is available through the interfaces below.

Nerdamer Scripting

Nerdamer Scripting

Use this form in Nerdamer Scripting input passed to nerdamer(...).

iferror(arg1, arg2)

← Back to Nerdamer Scripting