XRPLF / xrpl.js

A JavaScript/TypeScript API for interacting with the XRP Ledger in Node.js and the browser
https://xrpl.org/
1.2k stars 510 forks source link

Subscription error leads to process crash #1338

Closed ralexandr closed 3 years ago

ralexandr commented 3 years ago

Hi, i get this uncaught exception from time to time and it results on the whole process crash I make 'subscribe' request and then listen to 'transaction' events.

The version i'm using is 1.8.0 I can provide any additional info, but all points to the fact, that the problem is outside of my own code.

The issue is similar to https://github.com/ripple/ripple-lib/issues/885 but it has been marked as 'resolved' and closed.

[1607270345004] ERROR: Unhandled error. ('reconnect') Error [ERR_UNHANDLED_ERROR]: Unhandled error. ('reconnect') at RippleAPI.emit (events.js:299:17) at RippleAPI.EventEmitter.emit (domain.js:482:12) at Connection. (/src/node_modules/ripple-lib/dist/npm/api.js:142:22) at Connection.emit (events.js:310:20) at Connection.EventEmitter.emit (domain.js:482:12) at /src/node_modules/ripple-lib/dist/npm/common/connection.js:209:26 at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:97:5)

intelliot commented 3 years ago

@ralexandr Do you have 'error' and 'disconnect' handlers added? See the boilerplate for an example: https://github.com/ripple/ripple-lib/blob/develop/docs/index.md#boilerplate

ralexandr commented 3 years ago

Thank you! It seems that it will resolve my issue

ralexandr commented 3 years ago

What if i use both .catch in my RippleAPI queries and client.on('error) for my ws-subcription to my-account's transactions. It looks like "on('error')" handler is global for all requests and i want to know if it will override 'catch' handlers. Or both ".catch" and ".on('error')" will be emitted ?

ralexandr commented 3 years ago

Oh, i've found an answer in text below boilerplate exaple: "The "error" event is emitted whenever an error occurs that cannot be associated with a specific request"

Thanks

monistillbear commented 10 months ago

I have the same issue, but the provided link is no longer valid. @ralexandr could you share your sollution?

mvadari commented 10 months ago

@monistillbear if you're using ripple-lib still, that library is no longer supported. Please use xrpl.js instead.

monistillbear commented 10 months ago

@mvadari I am using xrpl.js and the issue is there

mvadari commented 10 months ago

@monistillbear please open a new issue with the details then. The cause is probably different.