FIND YOUR NEXT FEW LINES

Results for “Functions & error handling”

Small, practical examples. Search by task or narrow things down below.

156 snippets foundClear filters
Bash ScriptsFiles & reliability

Detect an error inside a pipeline

Use pipefail to observe failure before the last pipeline command.

pipefail✓ Tested
TypeScriptSafe data handling

Safely read a caught error

Check the error type before accessing its message.

unknown✓ Tested
Bash ScriptsFunction scope & composition

Capture output while handling a failed command

Bash Scripts: An assignment inherits the status of its command substitution, allowing both output and status to be handled.

Bash Scripts✓ Tested
Bash ScriptsInput streams & redirection

Capture standard output and standard error separately

Bash Scripts: Use distinct redirections when diagnostic text should not be mixed with data.

Bash Scripts✓ Tested
GoErrors & validation

Combine independent validation errors

Combine independent validation errors using a complete Go program with explicit sample inputs.

Go✓ Tested
SQL ServerSelect & page

Convert text without raising a conversion error

Return NULL when a numeric conversion fails.

TRY_CONVERT✓ Tested
AngularReactive forms

Display a specific reactive validation error

Display a specific reactive validation error with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
GoTesting & reusable helpers

Distinguish end-of-input from other errors

Distinguish end-of-input from other errors using a complete Go program with explicit sample inputs.

Go✓ Tested
PowerShellGetting Started

Handle an expected terminating error

PowerShell: Handle an expected terminating error using PowerShell 7.

PowerShell✓ Tested
GoErrors & validation

Inspect a typed conversion error

Inspect a typed conversion error using a complete Go program with explicit sample inputs.

Go✓ Tested
Bash ScriptsFunction scope & composition

Load functions from a trusted local script

Bash Scripts: Source executes a file in the current shell so its function definitions remain available.

Bash Scripts✓ Tested
RustErrors & optional values

Propagate a parsing error with question mark

Propagate a parsing error with question mark in a complete Rust program using the standard library.

Rust✓ Tested