-
Notifications
You must be signed in to change notification settings - Fork 376
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
node.js UnhandledPromiseRejectionWarning #878
Comments
Please format your issue correctly next time, see https://guides.github.com/features/mastering-markdown/ xmpp.js implements reconnect by default - you are probably messing with it See |
it would still be good to catch the exception i had to change the code to this:
|
That's a different issue, see #866 BTW it's your application job to catch exceptions. xmpp.js can and will throw when an error occurs. |
sometimes the nodejs program crashes on reconnect attemt
await xmpp.stop();
while(xmpp.status!=='offline'){
await sleep(500);
}
try{
await xmpp.start(); // <<< unhandled error here (I do not know why error not catch in try block)
}catch (e) {
console.error(e);
}
with error:
(node:10315) UnhandledPromiseRejectionWarning: Error [ERR_STREAM_WRITE_AFTER_END]: write after end
at writeAfterEnd (_stream_writable.js:266:14)
at TLSSocket.Writable.write (_stream_writable.js:315:5)
at /home/ubuntu/node/node_modules/@xmpp/connection/index.js:342:19
at new Promise ()
at Client.write (/home/ubuntu/node/node_modules/@xmpp/connection/index.js:334:12)
at Client.open (/home/ubuntu/node/node_modules/@xmpp/connection/index.js:266:16)
at Client.start (/home/ubuntu/node/node_modules/@xmpp/connection/index.js:216:16)
The text was updated successfully, but these errors were encountered: