FIND YOUR NEXT FEW LINES

Results for “try catch”

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

186 snippets foundClear filters
ReactGetting Started

Pass data through props

Pass data through props with a small React component and explicit browser behavior.

React✓ Tested
PowerShellFunctions & parameter validation

Preserve a failure after local cleanup

PowerShell: A bare throw inside catch rethrows the current exception.

PowerShell✓ Tested
Bash ScriptsProcesses & environment

Preserve a failure status while an EXIT trap runs

Bash Scripts: Capture the status immediately on entry to the trap before running cleanup commands.

Bash Scripts✓ Tested
ReactLists & filtering

Preserve item state while reordering by key

Preserve item state while reordering by key with a small React component and explicit browser behavior.

React✓ Tested
ReactContext & shared state

Provide read-only application configuration

Provide read-only application configuration with a small React component and explicit browser behavior.

React✓ Tested
ReactAccessibility & events

Read a data attribute from the current target

Read a data attribute from the current target with a small React component and explicit browser behavior.

React✓ Tested
TypeScriptSafe data handling

Read a nested optional value

Avoid dereferencing a missing nested object.

optional chaining✓ Tested
ReactContext & shared state

Read a value from context

Read a value from context with a small React component and explicit browser behavior.

React✓ Tested
C#JSON & binary formats

Read an optional JSON property safely

C#: Use TryGetProperty instead of throwing when an optional property is absent.

C#✓ Tested
ReactRefs & DOM interaction

Read an uncontrolled field through a ref

Read an uncontrolled field through a ref with a small React component and explicit browser behavior.

React✓ Tested
ReactForms & validation

Read an uncontrolled form with FormData

Read an uncontrolled form with FormData with a small React component and explicit browser behavior.

React✓ Tested
ReactRefs & DOM interaction

Remember the previously committed value

Remember the previously committed value with a small React component and explicit browser behavior.

React✓ Tested