Smell #14: Silent Failure

Severity: High

Silent Failure: Code that catches or ignores errors without logging them, surfacing them to the user, or triggering alerts. It gives the illusion of a working system while data is being corrupted or services are down.

Symptoms

  • You have "Robust" try-catch blocks that return empty arrays or null on error.
  • Your project appears to "work" but users are reporting missing data or broken features.
  • Your logs are empty even during production incidents.
  • You are using AI-generated "Safe" wrappers around all your API calls.

Self-Assessment

If you find catch (e) { /* ignore */ } in your AI-generated code, you have Silent Failure.

Example

The "Robust" Data Fetcher

AI Output:

async function getTasks() {
  try {
    return await api.fetchTasks();
  } catch (error) {
    console.log("Something went wrong"); // Useless log
    return []; // SILENT FAILURE: looks like an empty list
  }
}

Why it's bad: If the API is down or the user is unauthorized, the UI shows "No tasks found." The user thinks they have no work; the team thinks the app is fine.

Debt Impact

This smell is the primary driver of Operational Debt:

| Debt Category | Impact | |---------------|--------| | ⚙️ OPS | Debugging becomes "Archaeology"—trying to find where the error was swallowed. | | 🔐 SEC | Security violations (like unauthorized access) may be hidden behind silent fails. |

How to Fix

  1. Audit Catch Blocks: Remove all empty or "log-only" catch blocks.
  2. Surface Errors: Ensure every failure is either handled gracefully (with a user message) or logged with a full stack trace.
  3. Fail Fast: If a module can't perform its job, let it throw an error rather than returning a "fake" successful result.

How to Prevent

  • The "Explicit Error" Clause: In your prompts, require: "All errors must be logged to our monitoring service with context."
  • Error Boundaries: Use UI Error Boundaries to catch and surface failures in a standardized way.
  • Review for "Default Returns": Reject any code that returns [], {}, or null inside a catch block without a clear explanation.

Related Smells

Book Reference

  • Chapter 6: Tool Calling & MCP — the dangers of silent failures in autonomous systems.
  • Chapter 8: Background Autonomy — how silent failures aggregate into production disasters.

Build observable systems, not silent ones