dafky2000
dafky2000
DDeno
Created by dafky2000 on 12/16/2024 in #help
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}`);
});
2 replies