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

Weird reaction on InputFile with path that does not exist #34

Closed
dzek69 opened this issue Sep 25, 2021 · 2 comments · Fixed by #78
Closed

Weird reaction on InputFile with path that does not exist #34

dzek69 opened this issue Sep 25, 2021 · 2 comments · Fixed by #78

Comments

@dzek69
Copy link
Contributor

dzek69 commented Sep 25, 2021

When I pass inexistent path to InputFile grammY probably still tries to read it. This simple code:

    bot.on("message", (ctx) => {
        console.log("start", new Date().toISOString());
        ctx.replyWithVideo(new InputFile("/tmp/this.does.not.exist")).catch(e => {
            console.error(e);
            console.error("end", new Date().toISOString());
        });
    });

Results in:

node             | start 2021-09-25T10:27:57.567Z
node             | HttpError: Network request for 'sendVideo' failed!
node             |     at ApiClient.call (/home/node/app/node_modules/grammy/out/core/client.js:55:27)
node             |     at processTicksAndRejections (node:internal/process/task_queues:96:5)
node             |     at ApiClient.callApi (/home/node/app/node_modules/grammy/out/core/client.js:68:22) {
node             |   error: FetchError: request to https://api.telegram.org/xxxxxxxxxxxxxxxxxxxx/sendVideo failed, reason: socket hang up
node             |       at ClientRequest.<anonymous> (/home/node/app/node_modules/node-fetch/lib/index.js:1461:11)
node             |       at ClientRequest.emit (node:events:402:35)
node             |       at ClientRequest.emit (node:domain:475:12)
node             |       at TLSSocket.socketOnEnd (node:_http_client:471:9)
node             |       at TLSSocket.emit (node:events:402:35)
node             |       at TLSSocket.emit (node:domain:475:12)
node             |       at endReadableNT (node:internal/streams/readable:1343:12)
node             |       at processTicksAndRejections (node:internal/process/task_queues:83:21) {
node             |     type: 'system',
node             |     errno: 'ECONNRESET',
node             |     code: 'ECONNRESET'
node             |   }
node             | }
node             | end 2021-09-25T10:28:57.618Z
@KnorpelSenf
Copy link
Member

KnorpelSenf commented Sep 29, 2021

Needs to fixed when the workaround for denoland/deno_std#1214 is implemented

@KnorpelSenf
Copy link
Member

@dzek69 please review the PR that fixes this.

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

Successfully merging a pull request may close this issue.

2 participants