FIND YOUR NEXT FEW LINES

Results for “error handling”

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

105 snippets foundClear filters
PythonFunctions & error handling

Yield values on demand

Python: Use a generator to produce a sequence without storing all intermediate values.

Python✓ Tested
TypeScriptSafe data handling

Safely read a caught error

Check the error type before accessing its message.

unknown✓ Tested
TypeScriptSafe data handling

Handle a result with a discriminated union

Separate success data from an error message.

discriminated union✓ 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
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