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

chore: improve error handling #3188

Merged
merged 11 commits into from
Nov 6, 2024
Merged

chore: improve error handling #3188

merged 11 commits into from
Nov 6, 2024

Conversation

magiziz
Copy link
Contributor

@magiziz magiziz commented Nov 4, 2024

Description

Improved error handling for auth and universal provider connector.

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

For Linear issues: Closes APKT-1400

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 Nov 4, 2024

Copy link

changeset-bot bot commented Nov 4, 2024

🦋 Changeset detected

Latest commit: ec606b2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
Name Type
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit-utils Patch
@reown/appkit Patch
@apps/demo Patch
@apps/gallery Patch
@apps/laboratory Patch
@reown/appkit-adapter-polkadot Patch
@reown/appkit-cdn Patch
@reown/appkit-common Patch
@reown/appkit-core Patch
@reown/appkit-experimental Patch
@reown/appkit-polyfills Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit-siwe Patch
@reown/appkit-siwx Patch
@reown/appkit-ui Patch
@reown/appkit-wallet Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

vercel bot commented Nov 4, 2024

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

Name Status Preview Comments Updated (UTC)
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 11:05am
appkit-vue-solana ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 11:05am
appkit-wagmi-cdn-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 11:05am
vue-wagmi-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 11:05am
web3modal-gallery ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 11:05am

Copy link
Contributor

github-actions bot commented Nov 4, 2024

Coverage Report for Coverage

Status Category Percentage Covered / Total
🔵 Lines 341.21000000000004% 4507 / 18764
🔵 Statements 341.21000000000004% 4507 / 18764
🔵 Functions 376.16999999999996% 372 / 1088
🔵 Branches 465.18000000000006% 683 / 1392
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/appkit/src/universal-adapter/client.ts 51.09% 46.77% 47.36% 51.09% 110-114, 132-133, 136, 141-142, 144-146, 158-162, 164-217, 230-232, 241-255, 271-287, 290-296, 298-304, 314-319, 322-326, 349-354, 358-363, 370-392, 398, 400-403, 429-450, 467-475, 503-504, 506, 511-512, 531-536, 547-556, 559-562, 566-594, 633-637, 642-645, 662-663, 675-700, 717-724
packages/appkit-utils/src/ErrorUtil.ts 0% 0% 0% 0% 1-44
packages/appkit-utils/src/LoggerUtil.ts 0% 0% 0% 0% 1-27
Generated in workflow #7215 for commit ec606b2 by the Vitest Coverage Report Action

]

for (const { alert, message } of errors) {
;(universalAdapter as any).handleAlertError(new Error(message))
Copy link
Collaborator

Choose a reason for hiding this comment

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

ew

},
JWT_TOKEN_NOT_VALID: {
shortMessage: 'Session Expired',
longMessage: 'Session expired - please connect again'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
longMessage: 'Session expired - please connect again'
longMessage: 'Invalid session found on UniversalProvider - please check your time settings and connect again'

@tomiir tomiir merged commit 69e8bde into main Nov 6, 2024
14 of 19 checks passed
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.

2 participants