node-telegram-bot-api icon indicating copy to clipboard operation
node-telegram-bot-api copied to clipboard

Socket Hang up

Open DaniyalGeek opened this issue 7 years ago • 3 comments

error: { Error: socket hang up at createHangUpError (_http_client.js:254:15) at TLSSocket.socketOnEnd (_http_client.js:346:23) at emitNone (events.js:91:20) at TLSSocket.emit (events.js:185:7) at endReadableNT (_stream_readable.js:974:12) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9) code: 'ECONNRESET' }

Can any one help me to understand why this happening

DaniyalGeek avatar Nov 22 '17 08:11 DaniyalGeek

+1

saeedhei avatar Nov 28 '17 03:11 saeedhei

+1

schizobulia avatar Oct 25 '18 06:10 schizobulia

In my case it was const stream = fs.createReadStream(filename) It was enough to close the stream after sending and the error disappeared bot.sendPhoto(msg.chat.id, stream).finally(() => stream.close())

Knoot avatar Jan 19 '22 10:01 Knoot