0

We run a continuous payments stream that receives fairly useless errors on the regular and would like to know what these may stem from and if they can be disregarded. I haven't been able to correlate these errors with error logs on our Horizon server. Below is the error being logged in node.js via the onerror callback:

Event { type: 'error', message: undefined }

Below is the source code that is triggering this error event:

    server
        .payments()
        .cursor('now')
        .stream({
            onerror: (error) => {
                if (error.messaged !== undefined) {
                    console.log(error);
                }
            },
            onmessage: (payment) => {
                if (payment.type_i !== 1) {
                    return;
                }

                // ... code to handle payment ...
            }
        });

Just to reiterate my question(s):

  • Why are we getting these errors from the stream?
  • Are these errors something we should be worried about?
  • How do we stop receiving these errors?
2
  • did you try with transactions? do you get the same error?
    – dolcalmi
    Commented Dec 13, 2018 at 3:14
  • Have observed the same on public and private Horizon instances (they behave exactly the same). All payments are found however and it looks like the errors can be safely ignored.
    – marcinx
    Commented Dec 13, 2018 at 10:00

1 Answer 1

1

If it's on your own Horizon server, it might just be that you haven't upgraded to the latest version.

Before a recent change was done, event streams were closed by the server once every 45(?) seconds or so, giving you an error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.