Turntable-API icon indicating copy to clipboard operation
Turntable-API copied to clipboard

Socket is not writable

Open mcgrailm opened this issue 12 years ago • 2 comments

at about 1 AM EST I got this error on more than 1 bot

net.js:391
    throw new Error('Socket is not writable');
          ^
Error: Socket is not writable
    at Client._writeOut (net.js:391:11)
    at Client.write (net.js:377:17)
    at [object Object].<anonymous> (/node_modules/ttapi/websocket.js:449:16)
    at [object Object]._send (/node_modules/ttapi/bot.js:299:12)
    at [object Object].updatePresence (/node_modules/ttapi/bot.js:333:9)
    at Timer.callback (/node_modules/ttapi/bot.js:148:47)

not sure if this is due to an interruption by tt or by my server ?

I would appreciate any advice you could give here Mike

mcgrailm avatar May 10 '12 10:05 mcgrailm

I get these every so often. I've always assumed they've been TT errors.
I would use something like forever or supervisor to run them,
because they automatically restart processes when the crash.

oldramen avatar May 10 '12 21:05 oldramen

Yayramen,

thank you those are good resources. To me though that sounds a like temporary solution. The fact that tt is unavailable shouldn't cause everything to come to a screeching halt. whatever is causing the error instead of throwing an error like that should come come back with a graceful response that can be bubbled up an appropriate point in the decision tree. So that a decision can be made programmatically about what should be done

a) keep trying x times b) skip and try again later

thats just an example.

Mike

mcgrailm avatar May 10 '12 22:05 mcgrailm