Failures are typed, carry their context, and arrive as alerts a human can act on — not stack traces nobody reads.
We treat errors as data, not as exceptions thrown into the dark. At the data layer, a failure is a typed value with a known category — not found, unauthorized, conflict, validation. The service layer maps those into domain outcomes it understands, and only at the very edge does an error become a client-facing response, carrying a stable code and a human-readable hint instead of a raw stack trace. Because errors are explicit return values that flow through the code rather than thrown, the compiler forces every caller to handle the failure case — there is no silent path where an error is dropped and a function returns half-finished.When something genuinely unexpected happens, the goal is to debug it without a debugger. Every unexpected failure emits one structured log line carrying the context that actually matters: which operation, which user, which region, the request details, the inputs. That is usually enough to understand a problem from the log alone, without reproducing it. A separate lightweight process watches the production log stream, and when it sees a real error it emails an actionable summary — so the team learns about a problem from an alert, not from a customer.The detail that separates a real production system from a demo is signal management. Public endpoints are constantly probed by bots and scanners that generate noise indistinguishable, at a glance, from real failures. We filter alerting to traffic that came through our own SDK — genuine clients identify themselves; scanners do not — so the alerts a human sees are the ones worth waking up for. Tuning the signal down to what matters is the part you only build after you have actually operated something under load.
In practice: a production error emails a plain-language summary with the operation, user, and region attached — while probes hitting the same endpoint are filtered out by checking for our client identifying header. The alert that arrives is real; the noise never reaches anyone.