Skip to main content

Disable Error Handling In Block (unsafe)

Laurence MorganLess than 1 minuteBuiltin CommandsError Handling

Disable Error Handling In Block (unsafe)

Execute a block of code, always returning a zero exit number

Description

unsafe is similar to normal execution except that the exit number for the last function in the unsafe block is ignored. unsafe always returns 0.

This is useful in any situations where you might want errors ignored.

Usage

unsafe { code-block } -> <stdout>

<stdin> -> unsafe { -> code-block } -> <stdout>

Examples

try {
    unsafe { err "foobar" }
    out "This message still displays because the error is inside an `unsafe` block"
}

See Also


This document was generated from builtins/core/structs/try_doc.yamlopen in new window.

Last update:
Contributors: Laurence Morgan