Skip to content

feat: add shared trackError util - #246

Merged
taran-a merged 6 commits into
mainfrom
feat/shared-track-error-util
Sep 2, 2026
Merged

feat: add shared trackError util#246
taran-a merged 6 commits into
mainfrom
feat/shared-track-error-util

Conversation

@taran-a

@taran-a taran-a commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Explanation

Create shared trackError util

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

@taran-a
taran-a marked this pull request as ready for review September 1, 2026 15:11
@taran-a
taran-a requested a review from a team as a code owner September 1, 2026 15:11
@taran-a
taran-a force-pushed the feat/shared-track-error-util branch 2 times, most recently from 4002b2b to 8fa2cf2 Compare September 1, 2026 15:24
Base automatically changed from feat/move-errors-into-shared-pkg to main September 2, 2026 08:40
@taran-a
taran-a requested a review from a team as a code owner September 2, 2026 08:40
@taran-a
taran-a force-pushed the feat/shared-track-error-util branch from 8fa2cf2 to 7c14039 Compare September 2, 2026 08:58
@taran-a
taran-a force-pushed the feat/shared-track-error-util branch from 7c14039 to 84b9966 Compare September 2, 2026 08:59

@mikesposito mikesposito left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a small question

Comment on lines +8 to +11
export function getSnapProvider(): SnapsProvider {
// snap is a global variable provided by the Snap SDK
return snap;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'm wondering, do we really need this function to use a globally available variable?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is needed mainly for tests, to get this global var when it is called

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we mock the global variable instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes we can for sure, imo mock a function is easier, I saw this pattern in Stellar snap, but they use this as a global pattern all over the snap to not get the snap var explicitly in different places.

so if you think its cleaner to pass the global snap to the shared util I will change

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to block this PR, we can consider this as a discussion to follow-up on if this is a pattern already used elsewhere

@taran-a
taran-a added this pull request to the merge queue Sep 2, 2026
Merged via the queue into main with commit 0673e56 Sep 2, 2026
54 checks passed
@taran-a
taran-a deleted the feat/shared-track-error-util branch September 2, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants