Results for “error”
Small, practical examples. Search by task or narrow things down below.
Calculate a simple packet XOR checksum
Arduino / C: XOR all payload bytes to produce a basic error-detection byte.
Arduino / C✓ Tested
Check an external process exit status explicitly
PowerShell: LASTEXITCODE reports a native child exit code independently of ordinary PowerShell cmdlet errors.
PowerShell✓ Tested
Check whether a command can be resolved
PowerShell: Get-Command with a local error override supports an expected missing-command lookup.
PowerShell✓ Tested
Compare bounded floating-point results with a tolerance
JavaScript: Use an absolute error threshold for values known to be near one.
JavaScript✓ Tested
Compare bounded floating-point results with a tolerance
TypeScript: Use an absolute error threshold for values known to be near one.
TypeScript✓ Tested
Compare floating-point results with a tolerance
Java: For this bounded example, compare the absolute difference against a chosen error threshold.
Java✓ Tested
Compute a simple XOR checksum
C: XOR all payload bytes into one byte to demonstrate a basic error-detection field.
C✓ Tested
Copy a file in bounded binary chunks
C: Check read, write, and close errors while copying without loading the entire file.
C✓ Tested
Create a file without overwriting an existing one
Python: Use exclusive creation mode and handle FileExistsError explicitly.
Python✓ Tested
Delete a known temporary file if present
Java: deleteIfExists returns whether a file was removed and still reports other I/O errors.
Java✓ Tested
Measure a small seekable binary file
C: Seek to the end and inspect ftell, checking both operations for errors.
C✓ Tested
Pair corresponding array items by position
JavaScript: Validate equal lengths before zipping when missing counterparts would be an error.
JavaScript✓ Tested