Level 1 · Apprentice0 XP
Exceptions, custom errors, retries with back-off for model APIs, and structured logs.
Step 1 / 6
ProblemA batch job wraps each model call in try/except: pass. 18% of calls fail silently with rate-limit errors, and the evaluation report looks great because failures are simply missing.
← → step
Before this: Typing in depth: generics, Protocols and checkers
🛠️ Your turn
Reading is not the skill, doing is. Try for ten minutes before you open the hint. Getting stuck first is what makes the solution stick.
1.Wrap a model call with tenacity: retry only rate-limit and server errors with exponential back-off and jitter, stop after five attempts, log each retry, and let bad requests fail immediately. Write a test with a fake that raises each error type.