Results for “ERROR_NUMBER”
Small, practical examples. Search by task or narrow things down below.
Find the mean and median of readings
Python: Use statistics helpers to distinguish an arithmetic mean from a middle value.
Python✓ Tested
Handle a failed conversion
Handle a failed conversion using a complete Go program with explicit sample inputs.
Go✓ Tested
Handle a failed file open through stream state
C++: An unopened input stream is not an empty successful file read.
C++✓ Tested
Handle a failed string-to-integer conversion
C++: stoi throws invalid_argument when no conversion can be performed.
C++✓ Tested
Handle a malformed JSON document
PowerShell: ConvertFrom-Json reports a terminating conversion error under the selected error preference.
PowerShell✓ Tested
Handle a result with a discriminated union
Separate success data from an error message.
discriminated union✓ Tested
Handle an asynchronous failure
Handle an asynchronous failure with a small React component and explicit browser behavior.
React✓ Tested
Handle an expected child-process failure
Python: Catch CalledProcessError when check=True reports a nonzero exit status.
Python✓ 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