chore(sonar): address remaining S2486 swallowed exceptions#105
Merged
chore(sonar): address remaining S2486 swallowed exceptions#105
Conversation
Clear all 62 flagged swallowed-exception catches across 8 packages by renaming bare catch variables to underscore-prefixed descriptive names with WHY comments. No logic changes; all catch behaviour preserved. Refs #38 #45. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Conflict in BigNumber.ts resolved by taking origin/main's structure (uses _initFromString helper from W5 PR #100) and applying the W6 S2486 catch rename (_bigIntParseError) to the helper's BigInt parse path.
|
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.




Summary
catch (e)/catch (error)/catch (err)/catch (_)variables to descriptive underscore-prefixed names with WHY comments across 8 packagesFiles changed:
packages/wallet/btms-permission-module/src/BasicTokenModule.ts— 5 catches (PushDrop parse, metadata parse, capture error)packages/wallet/wallet-toolbox/src/WalletPermissionsManager.ts— 4 catches (callback error, manifest fetch, decrypt-fallback ×2)packages/sdk/src/overlay-tools/SHIPBroadcaster.ts— 1 catch (non-SHIP output skip)packages/sdk/src/primitives/BigNumber.ts— 1 catch (BigInt parse re-throw)packages/middleware/payment-express-middleware/src/index.ts— 1 catch (malformed JSON header)packages/middleware/auth-express-middleware/src/index.ts— 1 catch (response already sent)packages/messaging/message-box-client/src/PeerPayClient.ts— 1 catch (JSON parse)packages/sdk/src/identity/IdentityClient.ts— 1 catch (cert verification re-throw)Test plan
pnpm --filter @bsv/sdk run test— 5556 passedpnpm --filter @bsv/wallet-toolbox run test— 975 passedpnpm --filter @bsv/btms-permission-module run build— cleanpnpm --filter @bsv/payment-express-middleware run test— 1 passedpnpm --filter @bsv/auth-express-middleware run test— 20 passedpnpm --filter @bsv/message-box-client run test— 72 passednode conformance/runner/src/runner.js— 6601/6601 PASSRefs #38 #45.
🤖 Generated with Claude Code