AI-generated code handles the version of your system where everything works. It has almost no opinion about the version where a token expires, a dependency times out, or a job finishes and silently returns nothing.
The Details:
Models generate code by pattern-matching against examples, and success stories vastly outnumber failure stories in that training data. When the model does add a try-except block or a retry loop, it is copying the shape of defensive code without the judgment behind it. A function can catch every exception gracefully and the system can still drift into a broken state nobody intended.
Local error handling and system-wide degradation are different questions. One asks what a function does when it catches an exception. The other asks how the whole system should behave while a dependency stays unavailable. A pipeline can have pristine error handling in every function and still have zero strategy for what happens when a credential quietly expires and posting stops for days.
Silent failures are costlier than loud ones because nothing stops to tell you. A crash gets noticed immediately. A job that reports success while producing empty output can run for weeks with every dashboard showing green, and the cost compounds the entire time nobody is looking.
Four decisions have to be made before any prompt gets written: how long to wait and retry before giving up, who or what gets escalated to on failure, what the user actually sees during degradation, and whether recovery drains automatically once the dependency returns. None of these can be inferred from working code; they have to be written down somewhere the model can read them.
Bottom Line: The model will always finish the happy path for you. Deciding how your system fails is a human job, and skipping it just delays the decision until it becomes an incident.
Enjoy this article?
Listen to the Claude Code Conversations radio show or join the community.