FIND YOUR NEXT FEW LINES

Results for “TRY CATCH”

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

186 snippets foundClear filters
SQL ServerTransactions & tables

Catch a T-SQL error

Handle an expected conversion error in TRY/CATCH.

TRY CATCH✓ Tested
PowerShellFunctions & control

Handle a terminating error

Catch conversion failures and produce a clear fallback.

try catch✓ Tested
C#Collections & data structures

Add a dictionary entry only if absent

C#: TryAdd reports a duplicate key without replacing its existing value.

C#✓ Tested
GitStashing selected work

Apply a stash while keeping the saved entry

Git: Apply restores changes without removing the stash reference.

Git✓ Tested
Docker / ComposeDockerfile patterns

Combine a stable entrypoint with default arguments

Docker / Compose: CMD supplies default arguments to an exec-form ENTRYPOINT.

Docker / Compose✓ Tested
RustMaps & sets

Count values with the entry API

Count values with the entry API in a complete Rust program using the standard library.

Rust✓ Tested
jQueryForm serialization & state

Delete a cached data entry

jQuery: removeData removes the jQuery cache value for the selected key.

jQuery✓ Tested
GoMaps & sets

Delete a map entry

Delete a map entry using a complete Go program with explicit sample inputs.

Go✓ Tested
JavaQueues & collection operations

Initialize a map entry only when absent

Java: Use computeIfAbsent when creating a collection for a new key.

Java✓ Tested
GoGetting Started

Look up a map entry

Look up a map entry using a complete Go program with explicit sample inputs.

Go✓ Tested
ReactAsync work & status

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
Docker / ComposeExecution & file transfer

Override an image’s entrypoint at runtime

Docker / Compose: An explicit entrypoint replaces the image entrypoint for this invocation.

Docker / Compose✓ Tested