Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network reset? #209

Closed
realjax opened this issue Jul 6, 2019 · 4 comments
Closed

Network reset? #209

realjax opened this issue Jul 6, 2019 · 4 comments

Comments

@realjax
Copy link

realjax commented Jul 6, 2019

Hi
I have the following situation ( using auto reconnect):

  • I start a connection to a gateway
  • I set a bunch of observers (gateway, devices, groupsAndScene and notifications)
  • on the "connection lost" update I stop all above mentioned observers

But then, as soon as first reconnect attempt is made i get this:
UnhandledPromiseRejectionWarning: Error: The network stack was reset. Pending promises will not be fulfilled

Which I dont understand.. was stopping the observers not sufficient? And where am I to catch/handle this error, on what promise? I tried on the 'connect' promise but that wasn;t the correct one from the looks of it..

Thanks.

@AlCalzone
Copy link
Owner

AlCalzone commented Jul 8, 2019

Do you have an event handler set up for the "error" event? If not, you should. You can then swallow the error there:
https://github.com/AlCalzone/ioBroker.tradfri/blob/master/src/main.ts#L643

Or see docs: https://github.com/AlCalzone/node-tradfri-client#handle-errors

It mostly informative, but the mentioned error is disruptive enough that I want developers to catch it.

@realjax
Copy link
Author

realjax commented Jul 8, 2019

Thanks, hadn't set that one up yet. I will try it out !

@realjax
Copy link
Author

realjax commented Jul 10, 2019

Thanks, worked fine. Does this also capture the error as mentioned in #108 by any change ?

@AlCalzone
Copy link
Owner

I'm not sure actually. Those DNS errors sometimes happen in internal callbacks I have no control over.
I remember some changes a while ago where I explicitly stopped using the internal DNS lookup methods for that reason. But it might be that I missed a spot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants