dafky2000
dafky20003mo ago

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}`);
});
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}`);
});
1 Reply
dafky2000
dafky2000OP3mo ago
My test is to connect to an invalid dns url.

Did you find this page helpful?