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

Socket Hang up #464

Open
DaniyalGeek opened this issue Nov 22, 2017 · 3 comments
Open

Socket Hang up #464

DaniyalGeek opened this issue Nov 22, 2017 · 3 comments

Comments

@DaniyalGeek
Copy link

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

@saeedhei
Copy link
Contributor

+1

1 similar comment
@schizobulia
Copy link

+1

@Knoot
Copy link

Knoot commented Jan 19, 2022

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())

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

4 participants