Skip to content

Commit

Permalink
chore: add error message for invalid project id (#3579)
Browse files Browse the repository at this point in the history
  • Loading branch information
magiziz authored Jan 7, 2025
1 parent 3ee19a2 commit 8ddfbf2
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .changeset/big-olives-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
'@reown/appkit-utils': patch
'@reown/appkit': patch
'@reown/appkit-adapter-bitcoin': patch
'@reown/appkit-adapter-ethers': patch
'@reown/appkit-adapter-ethers5': patch
'@reown/appkit-adapter-solana': patch
'@reown/appkit-adapter-wagmi': patch
'@reown/appkit-cdn': patch
'@reown/appkit-cli': 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
'@reown/appkit-wallet-button': patch
---

Added an error message for when the user provides an invalid project id.
8 changes: 8 additions & 0 deletions packages/appkit-utils/src/ErrorUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export const ErrorUtil = {
JWT_VALIDATION_ERROR: {
message: 'JWT validation error: JWT Token is not yet valid',
alertErrorKey: 'JWT_TOKEN_NOT_VALID'
},
INVALID_KEY: {
message: 'Unauthorized: invalid key',
alertErrorKey: 'INVALID_PROJECT_ID'
}
},
ALERT_ERRORS: {
Expand All @@ -32,6 +36,10 @@ export const ErrorUtil = {
longMessage:
'Invalid session found on UniversalProvider - please check your time settings and connect again'
},
INVALID_PROJECT_ID: {
shortMessage: 'Invalid App Configuration',
longMessage: 'Invalid Project ID - update configuration'
},
PROJECT_ID_NOT_CONFIGURED: {
shortMessage: 'Project ID Not Configured',
longMessage: 'Project ID Not Configured - update configuration on cloud.reown.com'
Expand Down
5 changes: 5 additions & 0 deletions packages/appkit/tests/appkit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1421,6 +1421,11 @@ describe('Base', () => {
alert: ErrorUtil.ALERT_ERRORS.JWT_TOKEN_NOT_VALID,
message:
'WebSocket connection closed abnormally with code: 3000 (JWT validation error: JWT Token is not yet valid:)'
},
{
alert: ErrorUtil.ALERT_ERRORS.INVALID_PROJECT_ID,
message:
'Uncaught Error: WebSocket connection closed abnormally with code: 3000 (Unauthorized: invalid key)'
}
]

Expand Down

0 comments on commit 8ddfbf2

Please # to comment.