Results for “error handling”
Small, practical examples. Search by task or narrow things down below.
Handle an asynchronous failure
Handle an asynchronous failure with a small React component and explicit browser behavior.
React✓ Tested
Handle an unsuccessful HTTP status
jQuery: fail receives the jqXHR object and exposes its status.
jQuery✓ Tested
Handle integer overflow without panicking
Handle integer overflow without panicking in a complete Rust program using the standard library.
Rust✓ Tested
Handle malformed JSON
C#: Catch JsonException for malformed JSON without swallowing unrelated failures.
C#✓ Tested
Handle malformed JSON input
Python: Catch JSONDecodeError without hiding unrelated programming errors.
Python✓ Tested
Increment a shared counter atomically
C#: Interlocked performs an indivisible update without a separate lock for this operation.
C#✓ Tested
Inspect a parsed URI
C#: Use Uri properties instead of splitting URL strings manually.
C#✓ Tested
Keep an optional value only when valid
Keep an optional value only when valid in a complete Rust program using the standard library.
Rust✓ Tested
Limit concurrent access with SemaphoreSlim
C#: Release the semaphore in finally so exceptions cannot leave it permanently acquired.
C#✓ Tested
Normalize identifier case consistently
JavaScript: Use toLowerCase for a simple case-insensitive ASCII identifier lookup.
JavaScript✓ Tested
Normalize identifier case consistently
TypeScript: Use toLowerCase for a simple case-insensitive ASCII identifier lookup.
TypeScript✓ Tested
Observe an exception from an asynchronous task
C++: Calling get rethrows an exception captured by the future.
C++✓ Tested