Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: error handling #4069

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

feat: error handling #4069

wants to merge 23 commits into from

Conversation

tomiir
Copy link
Collaborator

@tomiir tomiir commented Mar 25, 2025

Description

  • Adds TelemetryController to report errors to our Pulse API
  • Adds AppKitError abstraction to handle all of AppKit's potential erros. So far API_ERROR and INTERNAL_SDK_ERROR are used but types also contemplate secure site errors (coming next on secure site)
  • Adds withErrorBoundary util for controllers that intercepts requests and if they have uncaught errrors, fires a request to TelemetryController
  • WIP: Adds abstraction on top of AK's clients to catch uncaught errors and forward to telemetry

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

Closes APKT-2409

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

Copy link

linear bot commented Mar 25, 2025

Copy link

changeset-bot bot commented Mar 25, 2025

⚠️ No Changeset found

Latest commit: e8e7410

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Mar 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
appkit-demo ❌ Failed (Inspect) Mar 28, 2025 7:58am
appkit-laboratory ❌ Failed (Inspect) 💬 Add feedback Mar 28, 2025 7:58am
12 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-basic-ep ⬜️ Ignored (Inspect) Mar 28, 2025 7:58am
appkit-basic-ep-example ⬜️ Ignored (Inspect) Mar 28, 2025 7:58am
appkit-basic-example ⬜️ Ignored (Inspect) Mar 28, 2025 7:58am
appkit-basic-sign-client-example ⬜️ Ignored (Inspect) Mar 28, 2025 7:58am
appkit-basic-up-example ⬜️ Ignored (Inspect) Mar 28, 2025 7:58am
appkit-ethers5-bera ⬜️ Ignored (Inspect) Mar 28, 2025 7:58am
appkit-nansen-demo ⬜️ Ignored (Inspect) Mar 28, 2025 7:58am
appkit-vue-solana ⬜️ Ignored (Inspect) Mar 28, 2025 7:58am
appkit-wagmi-cdn-example ⬜️ Ignored (Inspect) Mar 28, 2025 7:58am
ethereum-provider-wagmi-example ⬜️ Ignored (Inspect) Visit Preview Mar 28, 2025 7:58am
next-wagmi-solana-bitcoin-example ⬜️ Ignored (Inspect) Mar 28, 2025 7:58am
vue-wagmi-example ⬜️ Ignored (Inspect) Mar 28, 2025 7:58am

@tomiir tomiir changed the title feat: error handling [wip] feat: error handling Mar 25, 2025
Copy link
Contributor

github-actions bot commented Mar 25, 2025

Warnings
⚠️ File .eslintrc.json contains a KEY or SECRET
⚠️ File packages/appkit/src/client/appkit-base-client.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/AlertController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/ApiController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/AssetController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/ChainController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/ConnectionController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/ConnectorController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/EnsController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/ModalController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/OnRampController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/RouterController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/SendController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/SnackController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/SwapController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/TooltipController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/TelemetryController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/utils/withErrorBoundary.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/controllers/TelemetryController.ts contains a KEY or SECRET
⚠️ File packages/controllers/src/utils/withErrorBoundary.ts contains a KEY or SECRET

Generated by 🚫 dangerJS against e8e7410

Copy link
Contributor

github-actions bot commented Mar 25, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 51.48% 7740 / 15033
🔵 Statements 51.48% 7740 / 15033
🔵 Functions 21.52% 269 / 1250
🔵 Branches 85.46% 541 / 633
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/controllers/exports/index.ts 100% 100% 100% 100%
packages/controllers/src/controllers/AlertController.ts 48.48% 100% 0% 48.48% 34-35, 38-52, 55-58
packages/controllers/src/controllers/ApiController.ts 25.08% 100% 0% 25.08% 77, 81-87, 91-95, 99-101, 105-107, 111-113, 117-119, 123-125, 129-138, 142-144, 148-150, 154, 158-176, 180-212, 216-246, 250-269, 273-300, 304-310, 314-330, 334-336, 340-348, 352-368, 169-288
packages/controllers/src/controllers/AssetController.ts 78.26% 100% 0% 78.26% 34, 38, 42, 46, 50, 54, 58, 62, 66-67
packages/controllers/src/controllers/ChainController.ts 21.28% 100% 0% 21.28% 86-88, 92-95, 99-115, 119-164, 168-179, 183-201, 205-214, 218-236, 240-249, 253-272, 276-286, 291-299, 303-317, 321-363, 367-374, 378-391, 395-416, 420-432, 436-448, 452-471, 475-484, 488-495, 499-506, 510, 514-521, 525, 529, 533-536, 540-546, 550-557, 561-567, 572, 576-588, 592-596, 600, 604-609, 613-617, 621-648, 652-707, 711, 715-735, 739-743, 747-753, 757-771, 780-786, 94-759
packages/controllers/src/controllers/ConnectionController.ts 23.78% 100% 0% 23.78% 95-99, 102-103, 106-107, 110-135, 138-143, 146-151, 154-170, 173-174, 177-178, 181-182, 185-186, 189-190, 193-194, 197-198, 201-202, 205-206, 209-210, 213-214, 217-218, 221-228, 231-233, 236-254, 257-258, 261-263, 266-267, 270-272, 275-276, 279-280, 283-284, 287-300
packages/controllers/src/controllers/ConnectorController.ts 29.92% 100% 0% 29.92% 52-54, 58, 62-67, 71-73, 77-99, 103-104, 108-131, 135-153, 157-165, 169-177, 181-202, 206-219, 223, 227, 230-234, 238-258, 267-271, 275-285, 294-298, 306-308, 312-318, 322-326, 330-334, 338-342, 346-347
packages/controllers/src/controllers/ModalController.ts 26.16% 100% 0% 26.16% 51, 55, 59-103, 107-132, 136-140, 144-145, 149-156
packages/controllers/src/controllers/RouterController.ts 20% 100% 0% 20% 126-127, 130-131, 134-171, 174-179, 182-185, 188-196, 199-232, 235-242
packages/controllers/src/controllers/SnackController.ts 36.06% 100% 0% 36.06% 43-44, 47-48, 51-52, 55-56, 59-61, 64-69, 72-93
packages/controllers/src/controllers/SwapController.ts 11.85% 100% 0% 11.85% 45-48, 171-172, 175-176, 179-213, 216-226, 229-230, 233-243, 246-249, 252-272, 275-290, 293-306, 309-314, 317-318, 321-322, 325-341, 344-357, 360-380, 383-401, 404-418, 421-429, 432-450, 453-487, 491-556, 560-599, 602-659, 662-711, 715-766, 769-853, 857-878, 882-901
packages/controllers/src/controllers/TelemetryController.ts 86.17% 68.42% 77.77% 86.17% 11, 18, 58-61, 69, 78, 97-98, 118-120, 60
packages/controllers/src/utils/withErrorBoundary.ts 10.86% 100% 0% 10.86% 11-20, 24-61, 26
Generated in workflow #10515 for commit e8e7410 by the Vitest Coverage Report Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants