Results for “try catch”
Small, practical examples. Search by task or narrow things down below.
Catch a T-SQL error
Handle an expected conversion error in TRY/CATCH.
TRY CATCH✓ Tested
Handle a terminating error
Catch conversion failures and produce a clear fallback.
try catch✓ Tested
Add a dictionary entry only if absent
C#: TryAdd reports a duplicate key without replacing its existing value.
C#✓ Tested
Apply a stash while keeping the saved entry
Git: Apply restores changes without removing the stash reference.
Git✓ Tested
Combine a stable entrypoint with default arguments
Docker / Compose: CMD supplies default arguments to an exec-form ENTRYPOINT.
Docker / Compose✓ Tested
Count values with the entry API
Count values with the entry API in a complete Rust program using the standard library.
Rust✓ Tested
Delete a cached data entry
jQuery: removeData removes the jQuery cache value for the selected key.
jQuery✓ Tested
Delete a map entry
Delete a map entry using a complete Go program with explicit sample inputs.
Go✓ Tested
Initialize a map entry only when absent
Java: Use computeIfAbsent when creating a collection for a new key.
Java✓ Tested
Look up a map entry
Look up a map entry using a complete Go program with explicit sample inputs.
Go✓ Tested
Offer a retry after a failed attempt
Offer a retry after a failed attempt with a small React component and explicit browser behavior.
React✓ Tested
Override an image’s entrypoint at runtime
Docker / Compose: An explicit entrypoint replaces the image entrypoint for this invocation.
Docker / Compose✓ Tested