feat: move errors helpers into shared pkg - #241
Open
taran-a wants to merge 6 commits into
Open
Conversation
taran-a
force-pushed
the
feat/move-errors-into-shared-pkg
branch
from
August 31, 2026 14:31
db053d3 to
bcb8156
Compare
taran-a
force-pushed
the
feat/move-errors-into-shared-pkg
branch
from
August 31, 2026 14:33
bcb8156 to
2652df8
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Centralizes Snap RPC error normalization and tracking wrappers in snap-networks-utils for reuse across wallet Snaps.
Changes:
- Adds shared error helpers, types, exports, and tests.
- Migrates Stellar, Solana, and Tron error handling to shared utilities.
- Updates tracking behavior, manifests, coverage configuration, and changelog.
Reviewed changes
Copilot reviewed 35 out of 35 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/tron-wallet-snap/src/utils/sensitiveErrors.ts |
Uses the shared RPC error guard. |
packages/tron-wallet-snap/src/utils/errors.ts |
Binds Tron tracking to the shared wrapper. |
packages/tron-wallet-snap/src/utils/errors.test.ts |
Updates wrapper integration tests. |
packages/tron-wallet-snap/src/clients/snap/SnapClient.ts |
Skips tracking user rejections. |
packages/tron-wallet-snap/src/clients/snap/SnapClient.test.ts |
Tests rejection suppression. |
packages/tron-wallet-snap/snap.manifest.json |
Updates the bundle checksum. |
packages/stellar-wallet-snap/src/utils/snap.ts |
Moves rejection filtering into tracking. |
packages/stellar-wallet-snap/src/utils/errors.ts |
Adopts the shared wrapper and types. |
packages/stellar-wallet-snap/src/utils/errors.test.ts |
Removes migrated utility tests. |
packages/stellar-wallet-snap/src/services/transaction/TransactionSynchronizeService.ts |
Uses the consolidated tracker. |
packages/stellar-wallet-snap/src/services/transaction/TransactionService.ts |
Uses the consolidated tracker. |
packages/stellar-wallet-snap/src/services/transaction/simulation/simulators.ts |
Updates tracking documentation. |
packages/stellar-wallet-snap/src/services/transaction-scan/TransactionScanService.ts |
Uses the consolidated tracker. |
packages/stellar-wallet-snap/src/services/sync/SynchronizeService.ts |
Uses the consolidated tracker. |
packages/stellar-wallet-snap/src/services/price/PriceService.ts |
Uses the consolidated tracker. |
packages/stellar-wallet-snap/src/services/on-chain-account/OnChainAccountSynchronizeService.ts |
Uses the consolidated tracker. |
packages/stellar-wallet-snap/src/services/on-chain-account/OnChainAccountSynchronizeService.test.ts |
Updates tracker spies. |
packages/stellar-wallet-snap/src/handlers/keyring/base.ts |
Uses the consolidated tracker. |
packages/stellar-wallet-snap/src/handlers/cronjob/trackTransaction.ts |
Uses the consolidated tracker. |
packages/stellar-wallet-snap/src/handlers/clientRequest/signAndSendTransaction.ts |
Uses the consolidated tracker. |
packages/stellar-wallet-snap/src/handlers/clientRequest/confirmSend.ts |
Uses the consolidated tracker. |
packages/stellar-wallet-snap/src/handlers/clientRequest/confirmSend.test.ts |
Updates tracker assertions. |
packages/stellar-wallet-snap/snap.manifest.json |
Updates the bundle checksum. |
packages/solana-wallet-snap/src/core/utils/errors.ts |
Adopts shared error utilities. |
packages/solana-wallet-snap/src/core/utils/errors.test.ts |
Updates tracking and wrapper tests. |
packages/solana-wallet-snap/snap.manifest.json |
Updates the bundle checksum. |
packages/snap-networks-utils/src/utils/logger/__mocks__/Logger.ts |
Adds a reusable logger mock. |
packages/snap-networks-utils/src/utils/errors/snapRpcError.ts |
Defines shared RPC error detection and types. |
packages/snap-networks-utils/src/utils/errors/index.ts |
Exports the error utilities. |
packages/snap-networks-utils/src/utils/errors/errors.ts |
Implements normalization and wrapper creation. |
packages/snap-networks-utils/src/utils/errors/errors.test.ts |
Tests shared error behavior. |
packages/snap-networks-utils/src/index.ts |
Publishes utilities from the package root. |
packages/snap-networks-utils/jest.config.js |
Excludes mocks from coverage. |
packages/snap-networks-utils/CHANGELOG.md |
Documents the new public exports. |
eslint-suppressions.json |
Removes obsolete suppressions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
taran-a
force-pushed
the
feat/move-errors-into-shared-pkg
branch
from
September 1, 2026 10:55
b449e00 to
fc77f9f
Compare
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
createWithCatchAndThrowSnapErrorfor handler-boundary error catching, logging, and Snap RPC normalizationnormalizeErrorfor converting caught values into Snap RPC errors, with optional custom normalizers viacreateWithCatchAndThrowSnapError'snormalizeErrorFnoptionisSnapRpcErrortype guard andSnapRpcErrorunion typeReferences
Checklist