Repository navigation
chore: getErrorData util for Sentinel API - #10642
Merged
Merged
Conversation
micaelae
force-pushed
the
swaps5091-get-error-data
branch
from
September 30, 2026 22:19
529e64a to
bbc4d51
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bbc4d51. Configure here.
This reverts commit 621cad5.
micaelae
enabled auto-merge
September 30, 2026 23:04
micaelae
force-pushed
the
swaps5091-get-error-data
branch
from
September 30, 2026 23:13
d81b093 to
7dbdc23
Compare
rarquevaux
approved these changes
Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Explanation
Export
getErrorDatautil which extracts data from Sentinel API errorsReferences
Fixes https://consensyssoftware.atlassian.net/browse/SWAPS-5091
Checklist
Note
Low Risk
Additive public utility and tests only; no change to fetch or controller success paths.
Overview
Adds and exports a public
getErrorDatahelper so consumers can turn Sentinel/smart-transaction failures into user-facing or analytics strings without reimplementing fetch error parsing.When
handleFetchrejects, it attaches camel-cased JSON on a thrown object’sdatafield (not a trueErrorinstance).getErrorDatareturnsdata.errorwhen it’s a string, otherwise JSON-stringifiesdata, and falls back toError.messageorString(error)for ordinary errors.Coverage includes unit tests for those branches and a
getFeesintegration test asserting a 400 Sentinel response still rejects withmessage: 'Fetch error: 400'and structureddata.error. The package changelog documents the new export.Reviewed by Cursor Bugbot for commit 7dbdc23. Bugbot is set up for automated code reviews on this repo. Configure here.