Business · Product · Technology · AI

Tell patients which failure occurred before offering recovery

A Movo-X native case tracing device versus network classification, semantic error codes, unknown-response fallbacks and rounded retry-wait labels without claiming actual recovery.

Work directly with Omer Muneer Qazi · Reviewed 29 November 2026

The scenario: the wrong error message sends people to the wrong remedy

A local storage failure, an unavailable network and a refused session can all stop a patient action. They need different responses. Calling every failure no connection can lead someone to retry an action that needs device attention; calling a temporary network problem signed out can unnecessarily disrupt the session.

Six existing Android JVM cases and three portable Swift cases passed against selected Movo-X message/classification logic. The inputs are synthetic exceptions, response metadata and retry values. This chapter follows what those local decisions establish and where installed screens, current service policy and successful recovery still need separate acceptance.

Classify device failures without preserving their raw values

The selected Swift conversion keeps an existing APIError, recognizes URL-loading errors as network failures and maps an otherwise unrecognized error to a local category containing its type name. An existing test passes a synthetic Keychain-like error and checks the local classification, nontransient status and device-facing UserMessage.

That does not execute a Keychain write or diagnose an actual operating-system failure. The type-only payload is also not an audit of every log or surrounding exception path. It establishes one conversion boundary. A production investigation still needs the failing operation and controlled diagnostics, while the patient-facing message should avoid exposing raw storage values.

Keep network and login notices consistent at the selected boundary

The Swift cases check a disconnected URL error, a timed-out URL error and a bridged URL-loading NSError. Another checks that the selected login machine and alternative sign-in notices distinguish device problems from network problems. This prevents those tested conversion paths from collapsing a local failure into the wrong message category.

The selected conversion also classifies CancellationError as network. That is a local representation choice exercised by a fixture; it is not a requirement to show a message for every cancelled task or automatically retry it. Callers still need appropriate cancellation propagation and lifecycle handling. These portable cases do not execute every sign-in screen or error catch in the installed app.

Use semantic codes before a broad HTTP label

The Android existing mapping case supplies several known error codes and checks their selected message enums. Its rate-limited example deliberately uses a different HTTP status to show that the recognized code decides that selected message. Session-ended, challenge-ended, reproof and unavailable outcomes have their own mapped meanings.

The inspected source gives a recognized reason refinement precedence over the general code, then applies selected fallback rules. Reason refinement was source-reviewed rather than covered by these six cases. The mapper does not independently verify that a server emitted a truthful code or that the session is actually revoked. Authoritative session transitions remain a separate responsibility.

Distinguish unknown contract codes from bodiless responses

An existing Android case supplies an unknown structured code with several statuses and expects the generic message. Another uses the selected synthetic http-status codes, representing an unparsed response body, and checks rate-limit/service-unavailable fallbacks. These are intentionally different categories in that implementation.

This distinction avoids silently attributing a newly introduced server code to the wrong known condition. It does not establish that every real proxy response reaches the synthetic-code branch correctly. The HTTP parser, malformed-body handling and installed server need their own acceptance. Do not claim exact cross-platform fallback parity from Android mapping cases and Swift local-error cases that test different inputs.

Round a wait estimate without treating it as enforcement

The Android retry-label case checks selected positive retry values rounded up into minutes, hours or days: a short wait becomes one minute, sixty-one seconds becomes two minutes and a little over one hour becomes two hours. Missing/nonpositive values and a nonrate-limit status do not produce the generic wait pair in the tested branches.

These integers describe display estimates. They are not a client-enforced release time and do not demonstrate that the server will accept a later request. The fixtures also do not cover every extreme integer or server-header representation. Keep header parsing, arithmetic bounds, countdown refresh and authoritative rate-limit policy in the acceptance plan.

Give proof-cooldown copy its own selected unit policy

The selected Android logic separates proof cooldown from the generic retry line. Its existing case checks day rounding and the absence of the ordinary minutes/hours/days pair for that code, including a short positive interval that displays at least one day. It also checks that another code does not receive the special day result.

This is a display-unit policy, not evidence of a real account block or its duration. A rounded label can be deliberately approximate, so wording and the current authoritative policy need review together. Do not infer an actual unlock time or a verified recovery path from the fact that a local helper returned a day count.

Connect classification to rendered recovery actions

The inspected Android ErrorBox maps the selected enum to a resource, renders a retry estimate when available and can add relevant recovery controls from separate predicates. The inspected Swift UserMessage and login-notice functions similarly map categories to messages used by their callers. Those source connections were reviewed but the actual screens were not rendered here.

Test language, plural forms, accessibility and available actions with controlled failures. A clear label is only one part of recovery: the correct screen should offer an applicable action without discarding useful state or repeating an uncertain write. The nine local cases do not establish translation quality, actual device repair or successful session reauthentication.

A failure-and-recovery engineering handover

Retain the nine scoped cases and extend acceptance through the real parser, native screen and current service contract. Include unavailable connectivity, a controlled local-store refusal, unknown structured responses, retry metadata and interrupted requests. Verify that session state, draft preservation and operation identity follow the failure’s actual meaning.

For a CTO, the deliverable is a traceable decision chain: identify the failure category, choose the appropriate message, offer the permitted recovery and verify the resulting state. The selected evidence supports classification and selected wait labels. It does not turn a friendly error message into proof that recovery, delivery or a durable write has completed.

Compare the reviewed boundaries

A useful failure message needs the right evidence

On smaller screens, scroll across to compare every column. Keyboard users can focus the table and use the arrow keys.

BoundarySelected evidenceSeparate acceptance
Device versus networkSynthetic Swift exception and notice casesActual storage/transport and native caller handling
Semantic responseAndroid known/unknown/synthetic-code casesCurrent parser and authoritative session meaning
Retry labelSelected unit rounding and cooldown fixturesHeader bounds, wording and service policy
Recovery actionSource-defined message/UI connectionsRendered accessibility and completed recovery

Illustrative control flow

Pseudocode summarizing the decision boundary. It is not copied production code or a deployment instruction.

failure = classify_transport_local_or_service_error(error)
message = select_known_reason_or_code_then_documented_fallback(failure)
wait_label = format_selected_retry_estimate(failure)
offer_only_applicable_recovery(message, operation_state)
# Display classification is not session authority or proof that retry will succeed.

About this engineering series

Written by Omer Muneer Qazi from a review of Movo-X implementation and dated engineering records. This article explains source behaviour and historical observations; current production, clinical outcomes and store availability require their own verification. Examples are synthetic and proposed test cases are identified as such.

Explore the Movo-X engineering series → · Related implementation experience →

Discuss a similar engineering problem

Send the workflow, current platform and the decision your team needs to make. I can help define an implementation or review scope with concrete acceptance evidence.

Discuss your project on WhatsApp ↗
WhatsApp Omer about this project ↗