try-catch

noun
UK /ˈtraɪ kætʃ/
US /ˈtraɪ kætʃ/

A way to try doing something in code and catch any mistake so the program does not stop.

She wrapped the file reading in a try-catch so the app would not crash if the file was missing.


OTHER MEANINGS

2. A programming construct that runs risky code and handles any error it raises.

The try-catch caught the network error and showed a friendly message.

3. A defensive coding pattern used to keep a program running after unexpected problems.

Adding a try-catch around the login call made the app more stable.

4. A block of code paired with a handler that responds to thrown exceptions.

He moved the parsing logic into a try-catch to deal with bad input.