HTTP, JSON, APIs, secrets, and failure handling Handle service failures with clear retry and stop rules. Reviewed: 2026-10-03 Source-based teaching example · Fictional data Narration: Microsoft Mark · locally synthesized 00:00:00.000 — What you will learn Handle service failures with clear retry and stop rules. Visual description: Handle service failures with clear retry and stop rules. 00:00:06.583 — The idea Some failures may be temporary; others need a correction before another attempt. Limit both attempts and waiting time. Do not repeat a write if it might create a duplicate effect. Visual description: Some failures may be temporary; others need a correction before another attempt. Limit both attempts and waiting time. Do not repeat a write if it might create a duplicate effect. 00:00:21.125 — One useful term Retry budget. The maximum attempts and waiting time allowed for a request. Visual description: The maximum attempts and waiting time allowed for a request. 00:00:29.125 — A worked example The mock returns rate-limit and service errors, bad JSON and an authentication error. The exercise retries selected temporary failures within its budget. Bad JSON fails its format check; the authentication error stops immediately. Visual description: The mock returns rate-limit and service errors, bad JSON and an authentication error. The exercise retries selected temporary failures within its budget. Bad JSON fails its format check; the authentication error stops immediately. 00:00:48.500 — Your turn to think Should every failure be retried until it works? Pause and decide before continuing. Visual description: Should every failure be retried until it works? Pause the video if you need more time. 00:01:05.000 — Why this answer works No. Follow the declared rules. Protect repeated writes, respect the deadline and keep secrets out of logs. Visual description: No. Follow the declared rules. Protect repeated writes, respect the deadline and keep secrets out of logs. 00:01:15.917 — Check 1 Use the allowed attempt and time limits. Visual description: Use the allowed attempt and time limits. 00:01:21.250 — Check 2 Separate temporary and contract failures. Visual description: Separate temporary and contract failures. 00:01:27.083 — Check 3 Log outcomes rather than secret-bearing content. Visual description: Log outcomes rather than secret-bearing content. 00:01:33.042 — Now try a different case Open the lesson and try its different practice case. Use every check in the full task. Watching alone does not mark the lesson complete. Visual description: Open the lesson Try the new case Check and revise The full task and its requirements are in the linked lesson.