FIND YOUR NEXT FEW LINES

Results for “error handling”

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

105 snippets foundClear filters
GoErrors & validation

Return a descriptive validation error

Return a descriptive validation error using a complete Go program with explicit sample inputs.

Go✓ Tested
GoErrors & validation

Wrap an error with context

Wrap an error with context using a complete Go program with explicit sample inputs.

Go✓ Tested
RustErrors & optional values

Add context to a parsing failure

Add context to a parsing failure in a complete Rust program using the standard library.

Rust✓ Tested
C#Asynchronous work & URI handling

Await an asynchronous method result

C#: Use Task<T> for an async operation with a typed result.

C#✓ Tested
C#Asynchronous work & URI handling

Await multiple tasks while preserving result order

C#: Task.WhenAll returns results in the same order as the supplied tasks.

C#✓ Tested
RustErrors & optional values

Chain operations that may return None

Chain operations that may return None in a complete Rust program using the standard library.

Rust✓ Tested
JavaScriptText handling & Unicode

Check whether text ends with a suffix

JavaScript: Use endsWith for a literal case-sensitive ending.

JavaScript✓ Tested
TypeScriptText handling & Unicode

Check whether text ends with a suffix

TypeScript: Use endsWith for a literal case-sensitive ending.

TypeScript✓ Tested
JavaScriptText handling & Unicode

Check whether text starts with a prefix

JavaScript: Use startsWith for a literal case-sensitive prefix comparison.

JavaScript✓ Tested
TypeScriptText handling & Unicode

Check whether text starts with a prefix

TypeScript: Use startsWith for a literal case-sensitive prefix comparison.

TypeScript✓ Tested
JavaScriptText handling & Unicode

Compare canonically equivalent Unicode text

JavaScript: Normalize to NFC before comparing equivalent composed and decomposed text.

JavaScript✓ Tested
TypeScriptText handling & Unicode

Compare canonically equivalent Unicode text

TypeScript: Normalize to NFC before comparing equivalent composed and decomposed text.

TypeScript✓ Tested