Non-FictionAI OperatorError Management

Exception Handling for Operations eBook

Program automation rules that detect anomalies, lo

by Michael Kasi

  • English
  • 158 pages
  • 2026
  • SamEnrico

Program automation rules that detect anomalies, log failures, and reroute problematic transactions to the right ops team member instantly.

Formats

Free sample

Chapter 1: The Three States--–- Every operations engineer remembers their first silent failure. For Maya, it was a Thursday afternoon in mid-March. The payment processor had been humming along for eighteen months without incident, processing roughly forty thousand transactions per hour. Then, without a single log entry, without an exception, without any alert, it began writing settlements to the wrong general ledger account. The automation ran perfectly.

Every step completed. Every status check returned green. Every log file said "success."Three weeks later, the accounting department discovered a $2.3 million discrepancy. The automation had worked flawlessly—it had simply worked on the wrong data. The source file's column header had changed from "net_amount_cents" to "gross_amount_cents" without notice.

The automation didn't know the difference. It couldn't know. No one had told it what "normal" looked like.This is not a story about bad code. It is a story about the fundamental misunderstanding that plagues operations teams worldwide: the belief that if no exception is thrown, nothing went wrong.The Great Misconception Most operations teams spend 70 percent of their time fighting fires caused by failed automations. The industry has accepted this as normal—a cost of doing business at scale.

But the statistic reveals a deeper pathology. Teams are not spending 70 percent of their time on failures because failures are rare. They are spending 70 percent of their time on failures because they lack a coherent framework for understanding, detecting, and handling exceptions.The misconception begins with programming education. Every developer learns the try-catch block. They learn that exceptions are errors—things that go wrong, problems to be fixed.

They learn that a well-written program handles its exceptions gracefully, logs them, and continues. This is excellent advice for application code.It is dangerously incomplete for operations automation.Operations automation exists in a different universe. Application code runs in a controlled environment where inputs are validated, types are checked, and the state is managed by the program itself. Operations automation runs in the wild. It consumes CSV files from external vendors.

It calls APIs that change their schemas without notice. It processes data that was valid yesterday and invalid today. It depends on services that go down, come back up, and go down again.In this environment, the absence of an exception is not evidence of success. It is merely evidence that the automation did not crash. The automation could be corrupting data, writing to the wrong table, processing the wrong date range, or skipping transactions entirely—and never throw an exception.The $2.3 million typo happened because the automation succeeded at the wrong task.

Every operation engineer has a story like this. The stories differ in magnitude and industry, but the pattern is identical: the automation ran perfectly, the logs showed no errors, and something was catastrophically wrong.The Three States of an Automated Transaction To build exception handling that works in the real world, we must abandon the binary view of success and failure. The binary view comes from application development, where a function either returns a value or throws an exception. Operations automation requires a third state.State One: Success Success means the automation completed its intended work correctly. The transaction was processed, the data was written to the correct location, the API call returned the expected response, and the side effects (emails sent, payments captured, records created) are all correct.

Success is the goal. It is also, paradoxically, the least interesting state for an operations team. Success requires no action, no investigation, no escalation.But success is not simply "no exception." A successful transaction must satisfy both technical correctness (no crashes, no timeouts) and semantic correctness (the right thing happened to the right data). The $2.3 million typo was technically correct and semantically wrong. By the binary view, it was a success.

By the three-states view, it was something else entirely.State Two: Failure Failure means the automation encountered an error and stopped. A null pointer exception. A network timeout. A database connection pool exhausted. A malformed JSON response.

Failure is visible—it throws an exception, writes to stderr, and typically triggers an alert. Failure is painful, but it is honest. The automation admits that something went wrong.Most operations teams are reasonably good at handling failures. They have monitoring for 500 errors. They have retry logic for timeouts.

They have on-call rotations for crashes. The tools for failure handling are mature, well-understood, and widely implemented. This is why the industry has focused so heavily on failure—it is visible, measurable, and responsive to engineering.The problem is that failure is not the most dangerous state.State Three: Limbo Limbo is the transaction that neither succeeds nor fails. It is stuck. The automation started, did something, and then stopped—not with an error, but with uncertainty.

The API call timed out, but was the payment captured? The database transaction was interrupted, but were any rows committed? The file was partially written, but the automation crashed before closing the handle.Limbo is also the automation that completes technically but does the wrong thing. The $2.3 million typo is a Limbo transaction. So is the ETL job that processed yesterday's files instead of today's.

So is the data sync that wrote records to the staging table instead of production.Most operational disasters live in Limbo because Limbo transactions do not trigger alerts. They do not throw exceptions. They do not appear on dashboards. They simply sit, invisible and dangerous, until someone notices that the numbers do not add up.The three states framework forces a critical question for every automation: What is our plan for Limbo? If the answer is "we don't have one," then Limbo is not being managed—it is being ignored.

And ignored Limbo always, always becomes a disaster.Expected Errors Versus Unexpected Exceptions Before we can build detection and routing systems, we must distinguish between two categories of problems that are often confused: expected errors and unexpected exceptions.Expected Errors Expected errors are normal. They are part of the business logic. A customer entering an invalid credit card number is an expected error. A file upload that exceeds the size limit is an expected error. An API returning 404 for a resource that does not yet exist is an expected error.Expected errors should be handled with simple conditional logic—if-else statements, validation rules, and straightforward retries.

They do not require complex exception handling systems. They do not need to be routed to humans (unless the error rate spikes). They are normal operational noise.The mistake that teams make is treating expected errors as exceptions. When every invalid form submission generates a page to the on-call engineer, the on-call engineer learns to ignore pages. Expected errors should be counted, monitored for rate changes, and otherwise ignored.Unexpected Exceptions Unexpected exceptions are the true anomalies.

A database that suddenly returns binary data instead of JSON is an unexpected exception. A service that responds with HTML when the contract specifies XML is an unexpected exception. A transaction that takes ninety seconds when it usually takes two seconds is an unexpected exception.Unexpected exceptions cannot be handled by conditional logic because the conditions are not known in advance. They require detection rules (what does…

This is the end of the free sample. Get the eBook to keep going. Buy now

About this book

Program automation rules that detect anomalies, log failures, and reroute problematic transactions to the right ops team member instantly.

Details

Author
Michael Kasi
Publisher
SamEnrico
Language
English
Genre
Non-Fiction, AI Operator, Error Management
Released
2026-05-30
Pages (approx.)
158
Available as
eBook, Audiobook

Read better in the ZLOADR app

Your eBooks on your phone or tablet. Sign in with your SamEnrico account and start reading.

More by Michael Kasi

See all

You may also like

See all