Add error handling
Make code fail gracefully.
chatgptclaude
Act as a senior developer. Add robust error handling to the code below. Cover the failure cases that matter (bad input, network, null/empty, timeouts), fail loudly where appropriate, add clear messages, and avoid swallowing errors. Return the improved code and note what you hardened. Code: [paste]
How to use this prompt
- Tap Copy prompt above.
- Replace the [bracketed] parts with your own details.
- Paste it into chatgpt, claude.