potamides / pantran.nvim

Use your favorite machine translation engines without having to leave your favorite editor.
MIT License
289 stars 2 forks source link

curl exited with exit code 22 #7

Closed Dich0tomy closed 1 year ago

Dich0tomy commented 1 year ago

Everytime I run pantran in any way I get a vim.notify notification with the contents "curl" exited with error code 22!.

latest pantran version neovim version NVIM v0.9.0-dev-490+gf96fb23de curl version

curl 7.82.0 (x86_64-redhat-linux-gnu) libcurl/7.82.0 OpenSSL/3.0.5 zlib/1.2.11 brotli/1.0.9 libidn2/2.3.4 libpsl/0.21.1 
(+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.51.0 OpenLDAP/2.6.3
Release-Date: 2022-03-05
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smt
p smtps telnet tftp 
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNE
GO SSL TLS-SRP UnixSockets

fedora version Fedora release 36 (Thirty Six)

potamides commented 1 year ago

Curl manual says the following for error code 22:

HTTP page not retrieved. The requested URL was not found or returned another error with the HTTP error code being 400 or above. This return code only appears if --fail is used.

With which engine are you experiencing the problem?

Dich0tomy commented 1 year ago

I'm sorry, I forgot to share my config:

require 'pantran'.setup({
  default_engine = 'deepl'
})

Now the thing that stood up to me is that although docs specify deepl as a valid engine, running :lua =vim.tbl_keys(require("pantran.engines")) lists only { "apertium", "google", "yandex", "argos" }, does that have to do with issue, maybe?

potamides commented 1 year ago

Did you set up an API key? For DeepL to work you need to create an API key.

Dich0tomy commented 1 year ago

You are right, I missed that. Thank you!