digi.ai.in
← digi.ai.in / blog
2026-08-158 min readUX / Engineering Practice

Why We Write the Error Messages Before the Happy Path

Because on Indian payment rails and under Indian accessibility law, failure isn't an edge case — it's routine and legally regulated.

·

Most teams design the happy path first and bolt error states on at the end, usually as red text under a field. We do it backwards on purpose: we write the failure states, the timeout messages, and the "your payment didn't go through" screens before we touch the success flow. This isn't a stylistic preference. It's because for an Indian business, failure is not the rare case — it's a routine, high-volume, sometimes legally regulated event that has to be designed for on day one.

+

Error handling is not an afterthought in usability research

·

The Nielsen Norman Group, one of the most cited usability research bodies in the industry, treats error messaging as core UX work, not decoration. Its guidance is that effective error messages need to be highly visible, communicate constructively, and respect the effort the user already put in. NN/g's specific recommendation is to use noticeable, redundant, and accessible indicators — bold, high-contrast, and the conventional red styling that most users already recognize.

·

This isn't a new idea. It traces back to Jakob Nielsen's original usability heuristics from the 1990s, heuristic #9 specifically: "Help Users Recognize, Diagnose, and Recover from Errors," a principle still taught and cited as foundational design practice today https://www.uxlift.org/articles/error-message-guidelines/. Three decades later, the guidance hasn't changed, because the underlying problem hasn't changed: users hit walls, and how the interface responds to that wall determines whether they retry or leave.

+

The web platform itself was built error-first

·

This discipline isn't just a design opinion — it's written into the technical standards that run the web.

·

MDN's documentation on form validation shows that browsers themselves refuse to submit a form and immediately surface a built-in message like "Please fill out this field" the moment a constraint is violated — before any success state is even reachable https://developer.mozilla.org/en-US/docs/Learn_web_development/Extensions/Forms/Form_validation. The HTML spec goes further: every input element carries a dedicated validationMessage property, whose entire job is to hold "the error message that would be shown to the user during validation" https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/validationMessage. That's not a convenience feature. It means the error state is a first-class citizen of HTML itself, not something a developer improvises later.

·

The W3C formalizes this in its accessibility conformance techniques. Technique SCR32 exists specifically "to demonstrate the display of an error message when client side validation of a form field has failed" https://www.w3.org/WAI/WCAG22/Techniques/client-side-script/SCR32 — a standard, not a suggestion. Google's own developer guidance adds a warning many teams still get wrong: error and success states must never rely on color alone (red border vs. green border), because "for people with red-green color blindness a green and a red border look almost the same" https://web.dev/learn/forms/validation. If your only signal is a color change, a meaningful chunk of your users literally cannot see the difference between "you're done" and "you're stuck."

+

Where good sources actually disagree

·

We're not claiming universal consensus on every detail — the disagreement in the field is real, just narrower than people assume. Smashing Magazine argues real-time, inline validation is valuable because users "boost their confidence and create a sense of progress" as they fix each field https://www.smashingmagazine.com/2022/09/inline-validation-web-forms-ux/. But the same piece warns live validation is "frustrating when it fails" and can produce "an endless stream of disruptive error messages" https://www.smashingmagazine.com/2022/09/inline-validation-web-forms-ux/ if triggers are badly timed.

·

LogRocket's analysis flags the identical tension from the other side: firing validation logic too early creates what it calls a "premature error message" — one that appears "before a user has entered" complete data https://blog.logrocket.com/ux-design/ux-form-validation-inline-after-submission/, which adds cognitive load instead of removing it.

·

So the debate in the industry isn't over whether to design error states deliberately — every serious source agrees on that. It's over when the message should fire relative to what the user has typed. That's a real decision teams have to make field by field, not a reason to defer the whole problem.

+

Why this matters more in India specifically

·

Two facts specific to the Indian market make error-first design a business requirement, not a nicety.

+

1. Payment failure here is routine, high-volume, and disputed at the policy level

·

Estimates of UPI's failure rate vary by source, which itself tells you something about how much scrutiny this gets:

·
Source Failure rate claim
Kotak Mutual Fund analysis About 0.6%, "far lower than the 4% average for card payments"
Vyapar Gateway, citing NPCI 0.3–0.5% "Technical Decline Rate", which at India's volume still equates to "roughly 54 crore failed transactions per year — over 1.5 crore per day"
·

That gap between 0.3% and 0.6% sounds small until you multiply it by national transaction volume — at that scale, even the low estimate means tens of millions of failed transactions annually, every one of which needs a screen that tells the customer what happened and what to do next.

·

Regulators are already treating this as a systemic issue, not a one-off. Reporting shows NPCI logged downtime "for 11 banks in February 2026, while Bank of India had the maximum downtime for around 14 hours during the month," which triggered a government-led "UPI Cleanup Drive". Aadhaar-linked authentication, used across the India Stack for KYC and identity verification, is worse: Wikipedia's sourced summary notes "the failure rate was 8.5% for authentication using iris and 6% using fingerprints at the national level" in 2022 https://en.wikipedia.org/wiki/India_Stack.

·

For any business running checkout on UPI or onboarding on Aadhaar-based KYC, this means failure isn't a rare edge case you handle with a generic "something went wrong" toast. It is a routine, expected event at your current scale, and it deserves the same design attention as the checkout button itself.

+

2. Accessible error handling is Indian law, not just Indian best practice

·

The Rights of Persons with Disabilities Act, 2016 (RPWD Act) mandates equitable digital access for India's 26.8 million persons with disabilities and requires that "websites, apps, and digital content are accessible" across both public and private organizations. Two sections matter directly for interface design:

·
·

This isn't toothless. India's own Department of Empowerment of Persons with Disabilities confirms "non-compliance of the provisions of the Act or Rules thereunder has been made punishable by fines and imprisonment" https://depwd.gov.in/en/faqs-4/. Government-facing sites carry an additional layer through GIGW 3.0, which "aligns with the Rights of Persons with Disabilities Act 2016, the Harmonized Guidelines on Accessibility, and international standards the Web Content Accessibility Guidelines (WCAG) 2.1" https://www.skynettechnologies.com/blog/gigw-3-0-government-website-accessibility-in-india.

·

An error message that only shows as a red border, with no text and no programmatic label, fails this standard outright. Getting error-state design right is one of the more direct ways a business reduces its exposure under a law that already has enforcement teeth.

+

What "writing the error messages first" actually looks like

·

In practice, before we build a form or a checkout flow, we go through this checklist:

·
  1. List every way the step can fail — validation failure, network timeout, payment gateway decline, session expiry, server error, rate limiting.
  2. Write the exact message text for each failure, in plain language, stating what happened and what the user should do next — not just "error occurred."
  3. Decide the trigger timing for each message: on blur, on submit, or after a debounce — deliberately, given the documented risk of premature inline errors.
  4. Design the visual treatment without relying on color alone — text label plus icon plus color, per Google's accessibility guidance.
  5. Confirm the message is exposed to assistive technology, not just visually styled, in line with W3C's SCR32 technique.
  6. Only then build the success screen, the confirmation state, the "you're done" moment.
·

The ordering is deliberate. If you design the happy path first, the error states end up as an afterthought — a generic toast, a spinner that never resolves, a red asterisk with no explanation. If you design the failure states first, the happy path just becomes the one branch where nothing needed to be said.

+

Questions people also ask

+

Isn't designing error states first slower than shipping the happy path quickly?

·

It front-loads a conversation the team has to have eventually anyway. The alternative — patching in error copy after the flow is built — usually means retrofitting layout, spacing, and accessibility markup around a design that didn't anticipate them, which tends to take longer overall.

+

Does this apply to apps and dashboards too, or just checkout forms?

·

The same standards apply broadly. MDN's validation guidance and the W3C's SCR32 technique cover any form field in any web or app context, not just payment flows. Any interface with a state that can fail — login, file upload, data entry — benefits from the same discipline.

+

If UPI failure rates are under 1%, why treat it as a design priority?

·

Because national transaction volume turns a fraction of a percent into a very large absolute number. One estimate puts it at roughly 54 crore failed transactions a year — over 1.5 crore a day. At that scale, "rare" for the system as a whole still means routine for any individual high-traffic business.

Written by the studio behind digi.ai.in. Questions? hi@digi.ai.in or WhatsApp +91 98605 96905
WhatsApp us