01a0344d - fix(buy): hide FormatException on 502 and pin retry-only golden - #939
Conversation
|
EN: DE: DetailsReview: one pass to 0 findings on quality and logic. Mergeable against staging. No open review threads or PR comments. Commit |
Gateway 502 bodies like "error code: 502" were jsonDecoded and the resulting FormatException was shown on the buy quote screen. Parse error bodies via ApiException.fromBody and map HTTP 502 like 503.
The retry-only buy screen (no FormatException title) needs a committed baseline. PNG is produced by the self-hosted golden-regenerate workflow.
90f76b5 to
4fc7ce8
Compare
|
EN: DE: DetailsPass 1 covered the 502 parse fix. Pass 2 added |
EN:
A 502 with a plain-text body no longer crashes JSON parsing into a FormatException on the buy quote screen. The quote retry button remains; if the API sent no JSON message, only Retry is shown. A visual baseline pins that retry-only state.
DE:
Ein 502 mit Klartext-Body erscheint auf dem Kauf-Quote-Screen nicht mehr als FormatException. Der Wiederholen-Button bleibt; ohne JSON-Message zeigt die UI nur Wiederholen. Eine visuelle Baseline pinnt diesen Zustand.
Details
Gateway 502 responses with a non-JSON body (e.g.
error code: 502) were passed throughjsonDecode, which threwFormatException. That string was stored onBuyPaymentInfoFailure.messageand rendered as the info title.ApiException.fromBodynow decodes JSON objects viafromJsonand otherwise yields an empty user-facing message with the HTTP status. The buy payment-info service uses it on error paths. HTTP 502 is mapped like 503 (priceSourceUnavailable). The catch-all no longer copiesObject.toString()into the UI.A golden (
buy_price_source_unavailable_empty) pins the empty-message retry-only buy screen. The PNG is generated on the self-hosted runner viagolden-regenerate.yaml, not locally.