Skip to main content

Module errors

Module errors 

Source
Expand description

Error-rendering component — turns xa11y’s classified platform errors into messages that tell the model (and the user reading the trace) what to do next.

This is a COMPONENT, not a tool: it owns the Error variant → guidance mapping and nothing else. Every computer tool routes its map_err layer through render so a broken platform condition never reaches the model as a bare Platform error (-1): … — the error text is the one channel that always gets through, so it must carry the fix.

Design (plan phase 7): xa11y already classifies these conditions — PermissionDenied carries consent instructions, SelectorNotMatched and Timeout carry a [Diagnosis] — so this layer NEVER flattens that context away; it prepends the tool/context prefix, renders the variant guidance, and appends the diagnosis verbatim.

Functions§

render
Render an xa11y error for the model, prefixed by the failing tool and what it was doing (ctx, e.g. "resolve application").
render_app_miss
Render an APPLICATION-resolution miss (App::by_name/by_pid), the same rendering render produces plus the transient-shell hint: a flyout (Quick Settings, Notification Center, a shell context menu) is never an application — it does not appear in computer_apps and no app name can reach it, so the fix is surface targeting, not another lookup.