algolia/algoliasearch-client-node

Unhandled exception thrown by JSON.parse

Closed this issue · 2 comments

I've been occasionally getting the following exception from the JSON.parse call in _jsonRequestByHost_do, on v1.5.11:

SyntaxError: Unexpected end of input
  at Object.parse (native)
  at IncomingMessage.<anonymous> (/app/node_modules/algolia-search/algoliasearch-node.js:484:29)
  at IncomingMessage.g (events.js:180:16)
  at IncomingMessage.emit (events.js:117:20)
  at _stream_readable.js:943:16
  at /app/node_modules/newrelic/node_modules/continuation-local-storage/node_modules/async-listener/glue.js:177:31
  at process._tickCallback (node.js:419:13)

Thank you for reporting us that @traleig1. This bug has already been reported once (#13) but we never managed to reproduce it. Let's dig deeper!

Hey @traleig1, any chance you can test how it goes with the current master branch where I've added some retry logic + debug?