ding-dong icon indicating copy to clipboard operation
ding-dong copied to clipboard

Unhandled Promise Rejection when writing to a closed/unavailable socket

Open joebwan opened this issue 4 years ago • 1 comments

If the AGI socket closes for some reason ding-dong (context.js) will throw an unhandled promise rejection error.

See line 117 of context.js in master branch.

UnhandledPromiseRejectionWarning: Error [ERR_STREAM_WRITE_AFTER_END]: write after end at writeAfterEnd (_stream_writable.js:266:14) at Socket.Writable.write (_stream_writable.js:315:5) at Readable.write (node_modules/readable-stream/lib/_stream_readable.js:855:33) at Context.send (lib/context.js:117:15) at lib/context.js:130:10 at new Promise () at Context.sendCommand (lib/context.js:129:10)

joebwan avatar Sep 02 '20 18:09 joebwan

These errors do not get logged to STDOUT, but instead get bubbled up to node.js for logging to STDERR.

joebwan avatar Sep 02 '20 18:09 joebwan