errors-reliabilityAnswer last reviewed July 2026

How do you tell an operational error apart from a programmer error, and why would you treat them differently?

A strong answer classifies errors by what the failure says about process state, and gives each class its own recovery path

What an AI-prepared candidate might say

So operational errors are the failures you kind of expect even when your code is correct. A network timeout, a refused connection, a missing file, a 503 from some downstream service. Your program anticipates those and does something about them, retries, returns an error to the client, falls back to a default. Programmer errors are just bugs. Reading a property of undefined, passing the wrong type, calling an API the wrong way. You can't really handle a bug at runtime, so the standard advice is let the process crash, restart it under a supervisor, and go fix the code. In practice I think teams usually define custom error classes with a flag like isOperational, handle the operational ones close to where they happen, and let everything else propagate up to a top-level handler that logs and exits. The whole point of the distinction is you don't have to wrap every line in a defensive try/catch.

Senior
Locked

Why the split is really about invariants, where classification has to happen if it's going to survive layer boundaries, and what `err.code` buys you over `instanceof`.

Unlock the depth
Staff
Locked

How catch-all blocks quietly turn bugs into 'timeouts', the metrics that catch it happening, and the poison-message policy that keeps one bug from crash-looping a whole consumer fleet.

Unlock the depth
Follow-up chain
How do you tell an operational error apart from a programmer error, and why would you treat them differently? | NodeBook