Closed nickewansmith closed 4 years ago
This seems to make itself apparent on attempts to reconnect with no chance of success in a reasonable time period.
It looks like on https://github.com/ripple/ripple-lib/blob/27abc10d93237df6284e67c5cfc0d42a61061412/src/common/connection.ts#L374 the possible rejection of this.reconnect() is not handled in the catch block.
this.reconnect()
This can be duplicated in this way:
const RippleAPI = require('ripple-lib').RippleAPI; const api = new RippleAPI({ server: 'wss://s.altnet.rippletest.net:51233' }); const run = async () => { api.connection.connect = async function () { throw new Error('error on connect'); } setInterval( () => api.connection._heartbeat(), 1000); } run() .then(() => { console.log('Success'); }) .catch((e) => { console.error('Caught', e); });
Proposed fix for this issue https://github.com/ripple/ripple-lib/pull/1179
Closing thx!
This seems to make itself apparent on attempts to reconnect with no chance of success in a reasonable time period.
It looks like on https://github.com/ripple/ripple-lib/blob/27abc10d93237df6284e67c5cfc0d42a61061412/src/common/connection.ts#L374 the possible rejection of
this.reconnect()
is not handled in the catch block.This can be duplicated in this way: