Unable to connect + Uncatchable api error
See original GitHub issueI’m trying to connect to my unsynced node with api 1.0.0-beta.17
target=#750431 (25 peers), best: #520014
I’m getting
which is uncatchable with both of these
try {
let api = await ApiPromise.create().catch(e => {})
} catch (e) {}
It also doesn’t emit error on
provider.on('error',(e)=>{})
It results in stuck application since I can’t react on anything that happened here. It also happens when you get error while connecting to wsprovider
but it can be handled by wrapping api creation inside another promise, which I can reject. It is not ideal, but it works.
When trying to connect to wss://cc3-5.kusama.network/
I get this on the other hand
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
How to handle a possible uncatchable error in Javascript?
I've got a very small program in index.js, it tries to make a connection to a URL that does not exist, and makes...
Read more >The Elusive, Uncatchable Error? - Ben Gribaudo
The error seems to escape catching. When the expression is evaluated, Query Editor displays the error. Try loading the query's output into ...
Read more >Handling errors - Node-RED
These are uncatchable errors. If it does notify the runtime properly, then it is a catchable error that can be used to trigger...
Read more >API Connect error "Backside connection failed" when calling ...
Open your APIC management portal. · Expand the menu, and select Drafts. · Select the APIs tab, and open the API in question....
Read more >Unable to contact API | AdminUI Documentation
If you experience the error message “Unable to contact API”, it means that the AdminUI backend cannot successfully communicate with the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This looks like a good fix. It should be documented however to catch apiPromise.create() since it can crash now.
In this case you got very unlucky on Kusama. The issue is that at some point metadata v9 was actually broken - a type was added without changing the metadata version. (The bump to metadata v10 fixed that - retrospectively)
However, despite the brokenness there, going to keep this issue as logged and see what we can do around the error handling so it properly propagates.