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

[UI]: Errors impossible to catch and slows user progression in React (dev only) #297

Open
bchevalier opened this issue Dec 6, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@bchevalier
Copy link

bchevalier commented Dec 6, 2024

Describe the bug

Some errors are not caught by the errorHandlers of the onStatusChange setter.

For instance, upon calling tonConnectUI.openModal(), after selecting the OKX Wallet, the error [TON_CONNECT_SDK_ERROR] TonConnectError Aborted after attempts 1 is uncaught by the tonConnectUi component and is then caught by React which displays an error overlay.

Expected behavior

I expected to be able to catch every error, including the abort error inside the errorHandlers callback of the onStatusChange setter.

Current behavior

Instead the error cannot be caught.

Steps to Reproduce

  • Install the OKX Wallet browser extension.
  • Use the following code to trigger the wallet connection:
    const tonConnectUI = new TonConnectUI({
      manifestUrl,
    });

    tonConnectUI.onStatusChange(
      async (status: ConnectedWallet | null) => {
        // do something here
      },
      (error: TonConnectError) => {
        // handle error here
        console.error('error caught:', error);
      },
    );

    await tonConnectUI.openModal();
  • Select the "Browser Extension" log-in method when prompted

Environment

npm ls @tonconnect/{ui-react,ui,sdk,protocol,isomorphic-fetch,isomorphic-eventsource}:
├─┬ @tonconnect/[email protected]
│ ├── @tonconnect/[email protected]
│ ├── @tonconnect/[email protected]
│ └── @tonconnect/[email protected]
├─┬ @tonconnect/[email protected]
│ └── @tonconnect/[email protected] deduped
└─┬ @tonconnect/[email protected]
└── @tonconnect/[email protected] deduped

OS: MacOS v13.5
Browser: Chrome v131.0.6778.109

Additional context

No response

@bchevalier bchevalier added the bug Something isn't working label Dec 6, 2024
@bchevalier bchevalier changed the title [UI]: Errors impossible to catch and blocking user progression [UI]: Errors impossible to catch and blocking user progression in React (dev only) Dec 7, 2024
@bchevalier bchevalier changed the title [UI]: Errors impossible to catch and blocking user progression in React (dev only) [UI]: Errors impossible to catch and slows user progression in React (dev only) Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants