google-translate icon indicating copy to clipboard operation
google-translate copied to clipboard

HTTP Error

Open aarabii opened this issue 3 years ago • 4 comments

hey i was trying to make a translate command for my discord bot but i'm facing HTTPSError i have a simple code like this const arLang = await translate(Message, { to: 'ar' }); where Message is a message from a author and then it will send the translation to the discord channel and there is a catch block for err which gives HTTPError so IDK what should i do if you want i can provide you whole code too

note: 1st i thought i get this err cuz m trying to get 10 translation so i removed 9 of them but still the err was there

aarabii avatar Oct 05 '21 16:10 aarabii

Can you send the entire error log?

iamtraction avatar Oct 06 '21 13:10 iamtraction

`/home/runner/Touka-Kirshima/node_modules/@iamtraction/google-translate/src/index.js:142 let error = new Error(); ^

Error [HTTPError] at translate (/home/runner/Touka-Kirshima/node_modules/@iamtraction/google-translate/src/index.js:142:25) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async InteractionCollector. (/home/runner/Touka-Kirshima/SlashCommands/ContextMenu/translate.js:115:22) { statusCode: undefined, statusMessage: undefined`

aarabii avatar Oct 06 '21 13:10 aarabii

I am getting the same error as @losier. Any suggestions?

ElesGergo avatar Nov 07 '21 23:11 ElesGergo

I am also getting same error.

{ HTTPError
    at translate (/var/www/html/sawem/api/node_modules/@iamtraction/google-translate/src/index.js:142:25)
    at process._tickCallback (internal/process/next_tick.js:68:7)
  name: 'HTTPError',
  statusCode: undefined,
  statusMessage: undefined }

Sagar409-conflict avatar Feb 17 '22 17:02 Sagar409-conflict

Most likely a rate limit error. try with the latest version of the library. It'll show a more detailed error object.

iamtraction avatar Oct 14 '22 21:10 iamtraction