Sub topic 9
Error Paths, Edge Cases, and Dead Ends
This chapter assumes you can read and draw a flow diagram with terminators, steps, and decisions. It also assumes you can map a happy path and mark decision points. Here you extend those skills to everything that goes wrong, or goes unusually, on the way to a goal.
Why the unhappy paths matter
A happy path shows what happens when everything works. Real users also mistype, lose connection, run out of stock, and change their minds. If your flow shows only the happy path, developers will invent the rest during build. Each developer will invent it differently.
Error paths are often where users abandon a product. A vague message or a form that wipes your input can cost more trust than a missing feature. Mapping these paths early is cheaper than fixing them after launch.
Three terms to keep apart
- Error path: a route taken when something fails. The failure can come from the user (invalid input) or the system (server timeout).
- Edge case: a valid but unusual situation, such as a user with no saved addresses or a name with 80 characters. Nothing has failed. The situation is rare, extreme, or at a boundary.
- Dead end: a step with no way forward and no way back. The user is stuck, and the flow has no declared end point there.
An edge case may or may not lead to an error. A user with an empty cart is an edge case. Showing "Your cart is empty" with a link to the catalog handles it well. Showing a blank checkout page makes it a dead end.
Where errors come from
Walk through the happy path one step at a time and ask what can go wrong at each. A useful checklist has four sources.
| Source | Example | Typical response |
|---|---|---|
| User input | Email missing the "@" | Inline hint, keep entered data |
| System state | Server timeout, service down | Retry option, saved progress |
| Permissions and state | Not signed in, session expired | Prompt to sign in, then return to the step |
| Data conditions | No results, item sold out | Empty state with a next action |
Another source is the user's own choices. Users cancel, press Back, close the app, or leave and return a day later. These are not errors, but the flow should say what happens to their progress.
Drawing an error path
An error path is a branch that leaves a decision diamond. It ends in one of three places:
- A loop back to the step where the error happened, so the user can correct it.
- A recovery step that offers a different route, such as "Reset password."
- An end point that is declared, such as "Exit: contact support."
The sign-in flow below shows the first kind. A failed credential check leads to an error message, and the message returns to the form.
The loop is the key detail. If the arrow from "Show error message" were missing, the message step would be a dead end.
Designing the content of an error step
A box labeled "Show error" is not enough for a team to build from. For each error step, record these things in a note or an attached table:
- Trigger: the exact condition, for example "email field does not match the address pattern."
- Message intent: what the user must learn. State the problem and the fix.
- Preserved state: which entries survive. Clearing a long form after one mistake is a common cause of abandonment.
- Exit options: how the user continues, such as retry, edit, or get help.
Compare two messages for the same failure. "Error 401" gives the user nothing. "That email and password don't match. Try again or reset your password" names the problem and offers two exits. The second one maps cleanly to a loop and a recovery branch.
Recovery paths for system failures
Some failures are not the user's fault and cannot be fixed by retyping. For these, decide on the recovery strategy and draw it.
- Retry: loop back to the failed step, often with a limit. After three failures, branch to a different exit.
- Save and resume: store progress so the user can return later. Draw the re-entry as a separate entry point.
- Fallback: offer an alternative method, such as paying by another card.
- Escalate: hand off to support, with a declared end point.
The password reset flow below combines a validation loop with a retry limit on the reset link.
Notice that the expired-link branch sends the user back to step one with a clear message. It does not abandon them in the inbox.
Finding edge cases systematically
Edge cases are easy to miss because they rarely appear in research sessions. These prompts help surface them:
- Empty: no data yet, no results, no items.
- Extreme: very long text, very large numbers, hundreds of items.
- Boundary: the first and last item, the exact limit of a quota.
- Interrupted: closing the app mid-task, losing the network, receiving a phone call.
- Different user states: first-time versus returning, signed in versus guest, with or without permission.
- Concurrent: the same account open on two devices, or an item bought by someone else while it sits in the cart.
You will not draw every edge case on every diagram. A flow covering all of them becomes unreadable. Draw the ones that change the route. Handle the ones that only change the content, such as long text wrapping, in a separate note for the design and development team.
Dead ends
A dead end is a step with no outgoing connection that is not a declared end point. In a diagram, you spot it as a box with no arrow leaving it. Common causes:
- An error message with no retry or exit.
- An empty state with no call to action.
- A confirmation screen that offers no next step.
- A branch drawn quickly and never finished.
You can check this by hand, and for large flows you can check it with a script. If you store a flow as a map from each step to its next steps, any step with an empty list that is not a declared end point is a dead end.
const flow = {
open_app: ["has_account"],
has_account: ["login_form", "signup_form"],
login_form: ["credentials_valid"],
signup_form: ["home"],
credentials_valid: ["home", "login_error"],
login_error: [], // forgot to loop back
home: [],
};
const endpoints = new Set(["home"]);
const deadEnds = Object.entries(flow)
.filter(([step, next]) => next.length === 0 && !endpoints.has(step))
.map(([step]) => step);
console.log(deadEnds); // ["login_error"]Here the script flags login_error because its list of next steps is empty. Fix it by setting login_error: ["login_form"], and the output becomes an empty array.
The script finds only steps that lead nowhere. It cannot find a step that loops forever, such as two screens that only point to each other. It also cannot tell whether a message is useful. Treat it as a first filter and follow it with a human walkthrough.
Managing complexity
Error handling can bury the happy path. Three techniques keep the diagram readable.
- Collapse repeated errors. If five form fields share the same validation loop, draw one loop labeled "Any field invalid" and detail the rules elsewhere.
- Use a sub-flow. Replace a long recovery sequence with a single named step, such as "Recover account," and draw it in its own diagram.
- Style the paths differently. Draw the happy path as a straight line and use dashed or colored arrows for errors. State the convention in a legend.
These choices follow from the scope you chose for the flow. A stakeholder overview may show only the main error categories. A developer handoff needs every trigger and exit.
Common mistakes
- Only one error type. A single "Something went wrong" box merges input errors, network errors, and permission errors that need different responses.
- Loops without limits. A retry that can repeat forever hides the point where the system should escalate.
- Errors that erase work. The flow loops to the start instead of the failed step.
- Skipping the return trip. After a user signs in because their session expired, the flow should return them to where they were, not to the home screen.
- Treating cancel as an error. Cancel is a normal exit and needs its own end point, often with a "Discard changes?" decision.
Checking your work
Before sharing a flow, go through each decision diamond and confirm it has an outgoing arrow for every answer. Then trace each error branch until it reaches a loop, a recovery step, or a declared end point. Finally, ask a teammate to walk the flow with a specific failure in mind, such as "the payment is declined." Their questions show where the diagram is silent.
Exercise
A checkout flow has a step "Show 'Payment declined' message" with no arrow leaving it. (a) What is this problem called? (b) Give two ways to fix it. (c) Name one piece of state the flow should preserve.
Show answer
(a) It is a dead end: a step with no outgoing connection that is not a declared end point. (b) Add a loop back to the payment entry step so the user can try another card, and add a recovery branch such as "Choose a different payment method" or an exit to support. (c) The cart contents and the shipping details already entered, so the user does not start over.
Exercise
Classify each as an error path, an edge case, or a dead end: (1) a user with no saved addresses opens the address picker, (2) the server times out when submitting an order, (3) a "Your session expired" screen that has no buttons.
Show answer
(1) Edge case. Nothing failed, but the empty state needs a route such as "Add an address." (2) Error path. A system failure that needs a retry or save-and-resume branch. (3) Dead end. The message has no way forward, so it needs a "Sign in" action that returns the user to where they left off.