MMM-quote-of-the-day icon indicating copy to clipboard operation
MMM-quote-of-the-day copied to clipboard

Bad response

Open darshilchapadia opened this issue 6 years ago • 3 comments

Sometimes, API response is in string format instead of object.

darshilchapadia avatar Oct 17 '18 11:10 darshilchapadia

Can you give an output example?

Sispheor avatar Oct 17 '18 12:10 Sispheor

"{\"quoteText\":\"Freedom is what you do with what\\'s been done to you.\", \"quoteAuthor\":\"Jean-Paul Sartre\", \"senderName\":\"\", \"senderLink\":\"\", \"quoteLink\":\"http://forismatic.com/en/d714592782/\"}"

I am not able to parse this string.

darshilchapadia avatar Oct 17 '18 12:10 darshilchapadia

I get this error, the lang: da

[13.01.2021 14:08.56.848] [LOG] MMM-quote-of-the-day received a socket notification: GET_QUOTE - Payload: [object Object] [13.01.2021 14:08.56.930] [LOG] { "quoteText": "You can complain because roses have thorns, or you can rejoice because thorns have roses. ", "quoteAuthor": " Ziggy", "senderName": "", "senderLink": "", "quoteLink": "http://forismatic.com/en/a1538942bb/" } [13.01.2021 14:08.59.330] [ERROR] Error at /home/pi/MagicMirror/modules/MMM-quote-of-the-day/node_modules/google-translate-api/index.js:105:17 at processTicksAndRejections (internal/process/task_queues.js:93:5) { code: 'BAD_REQUEST' }

The-Exterminator avatar Jan 13 '21 13:01 The-Exterminator