fix(web): collapse backend/transport errors to a generic message #478
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-477-simpler-error-messages"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
ApiError::user_message()(bunyip-web) now returns a generic line for a transport / JSON-decode failure (status 0) and for any 5xx, instead of echoing the raw message. 4xx still passes through its API-authored, user-safe copy; 429 keeps its humanized retry line. All 62 call sites that renderuser_message()are covered by the single chokepoint, including the unauthenticated login page during an outage.Why (BUNYIP-477)
The reported leak surfaced during a boot abort (BUNYIP-457, since fixed). Rather than chase the boot/proxy layer with no incident artifact, the directive was simpler error messages that do not reveal internal detail. A sweep of every user-facing error-message surface found the request path is almost entirely clean already; the one browser-facing exception was
user_message()echoing a transport error's raw text (which carries the internal API URLhttp://bunyip-api:4401) and, defensively, any 5xx body.Sweep (invariant: no user-facing error message reveals internal detail)
AppError::error_response()JSON body:Internal/Database/Upstream/NotFoundmeta.request_idpresent; locked bytest_internal_error_hides_detailsFrom<sqlx::Error>"A database error occurred"; raw SQL only totracing::error!AppError::{validation,conflict,bad_request}sites (echo caller text)OidcInvalid*descriptions/e2e-bootstrappeduser_message()for transport (status 0) / 5xxJsonConfig/Path/Queryextractor defaultserror.message, absent in actix's default body); reveals API shape, not internal infrastructure. Flag if you want it hardened too - I will file + link an issue.Test
server_and_transport_errors_never_echo_internals: a 500 body carryingrelation "app.users" violates constraint ...and a status-0 transport error carryinghttp://bunyip-api:4401/...both collapse to generic text asserted to contain none of that detail.just check-containergreen (fmt + clippy + 183 web tests + full workspace).#BUNYIP-477