dafky2000D
Denoβ€’14mo agoβ€’
1 reply
dafky2000

Wierd issue with uncaught exception in WebSocketPovider on Canary

On stable the error listener block is executed but in canary (which I have been using as a fix to "Warning: Not implemented: ClientRequest.options.createConnection") the error doesn't seem to propogated to the listener and thus the rest of my code, instead an uncaught error is thrown, which is messing up my tests since I am expecting this error event to be thrown.

provider.on('connect', () => {
    console.info(`Connected to ${url}`);
});

provider.on('error', (error: any) => {
    console.error(`Error while connecting to ${url}:`, error);
});

provider.on('disconnect', () => {
    console.warn(`Disconnected from ${url}`);
});
Was this page helpful?