Stringify Exolix swap error response for readable logs#460
Conversation
Exolix's quote error handler logged the raw API error object via String(resJson), rendering it as the literal [object Object] and hiding the actual failure reason. Use JSON.stringify so the Exolix error payload is human-readable in logs.
46c35f7 to
5398fc6
Compare
|
Verified the patched log path runs in-app on the iOS simulator (edge-funds account, edge-exchange-plugins served live to the edge-core webview via DEBUG_EXCHANGES on :8083). The original repro (ARRR to ETH) no longer hits the 422 unsupported path: Exolix now returns a real fixed-rate quote for it. The branch in question (HTTP 422 whose body is not a min-amount rate response) is reached by a pair Exolix does not list. Used LLD (Liberland) to ETH. CDP console capture from the running app, with the patched bundle loaded: That SwapCurrencyError throw is the statement immediately after the patched Direct Exolix API confirms the object being stringified: Rendering for that body:
No bug surfaced; no code change beyond the committed fix. Also rebased onto master to clear the CHANGELOG conflict. |


CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
none
Description
Exolix's swap-quote error handler logged the raw API error response via
String(resJson). BecauseresJsonis a plain object (await response.json()),String()coerced it to the literal[object Object], hiding the actual reason a swap failed (e.g. ARRR→ETH) from the logs.Switch the interpolation to
JSON.stringify(resJson)so the underlying Exolix error payload is human-readable in logs. This line only fires on a 422 response that is not a recognized min-amount error, which is exactly the case where seeing the real payload matters; the thrownSwapCurrencyErroris unchanged, so there is no behavioral change beyond log readability.Before:
Error retrieving Exolix quote: [object Object]After:
Error retrieving Exolix quote: {"error":"Currency pair not available","code":"PAIR_UNAVAILABLE",...}Asana: https://app.asana.com/0/1215088146871429/1212885691958616
Note
Low Risk
Observability-only change on a warn log line; no swap logic, error types, or API handling changed.
Overview
Exolix quote failures on HTTP 422 (when the body is not a recognized min-amount shape) now log the full API JSON via
JSON.stringify(resJson)instead ofString(resJson), which previously produced useless[object Object]messages.Swap behavior is unchanged: the same path still throws
SwapCurrencyError. The Unreleased CHANGELOG documents this logging fix.Reviewed by Cursor Bugbot for commit 5398fc6. Bugbot is set up for automated code reviews on this repo. Configure here.