fix(web): log transport/decode detail suppressed from the user #480

Merged
nrupard merged 2 commits from fix/BUNYIP-477-log-suppressed-detail into main 2026-08-06 15:22:39 +02:00
Owner

What

Follow-up to #478 (merged). That PR made bunyip-web's user_message() show the browser a generic line for transport (status 0) and 5xx errors. This adds the other half of the invariant: the four sites that produce a status-0 ApiError now log the real detail for operators before returning the generic error.

  • Api::send, Api::get_stream, Api::post_form transport failures: tracing::warn!(error, url, "bunyip-api request failed (transport)").
  • parse() decode failure (a 2xx body that did not match the expected shape): tracing::warn!(error, "failed to decode bunyip-api response body").

Why (BUNYIP-477)

Per direction: the simple/generic message is for the end user; the full detail must still reach admins. In the transport case bunyip-api is unreachable, so bunyip-web is the only component that observes the failure at all. Without this, the detail was hidden from the user (correct) and logged nowhere (a gap).

just check-container green (fmt + clippy + full workspace, 183 web tests including the server_and_transport_errors_never_echo_internals regression lock).

#BUNYIP-477

## What Follow-up to #478 (merged). That PR made bunyip-web's `user_message()` show the browser a generic line for transport (status 0) and 5xx errors. This adds the other half of the invariant: the four sites that produce a status-0 `ApiError` now log the real detail for operators before returning the generic error. - `Api::send`, `Api::get_stream`, `Api::post_form` transport failures: `tracing::warn!(error, url, "bunyip-api request failed (transport)")`. - `parse()` decode failure (a 2xx body that did not match the expected shape): `tracing::warn!(error, "failed to decode bunyip-api response body")`. ## Why (BUNYIP-477) Per direction: the simple/generic message is for the end user; the full detail must still reach admins. In the transport case bunyip-api is unreachable, so bunyip-web is the only component that observes the failure at all. Without this, the detail was hidden from the user (correct) and logged nowhere (a gap). `just check-container` green (fmt + clippy + full workspace, 183 web tests including the `server_and_transport_errors_never_echo_internals` regression lock). #BUNYIP-477
fix(web): log the transport/decode detail suppressed from the user
All checks were successful
E2E PR gate / E2E / PR gate (pull_request) Successful in 13s
Check / fmt + clippy + build + tests (pull_request) Successful in 4m46s
03ae306b6b
The four sites that produce a status-0 ApiError (send / get_stream / post_form transport failures, and parse decode errors) now tracing::warn! the real error and the target URL before returning it. The prior commit made user_message() show the browser a generic line, so without this the detail an operator needs would be hidden from the user AND logged nowhere. In the transport case bunyip-api is unreachable, so bunyip-web is the only component that observes the failure at all.

Completes the invariant: generic message to the end user, full detail in the operator log.

#BUNYIP-477
Merge branch 'main' into fix/BUNYIP-477-log-suppressed-detail
All checks were successful
E2E PR gate / E2E / PR gate (pull_request) Successful in 22s
Check / fmt + clippy + build + tests (pull_request) Successful in 4m55s
Create release / Create release from merged PR (pull_request) Has been skipped
35086426d3
nrupard deleted branch fix/BUNYIP-477-log-suppressed-detail 2026-08-06 15:22:39 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/bunyip!480
No description provided.