keen / keen-analysis.js

A light JavaScript client for Keen
https://keen.io/docs/compute/
MIT License
40 stars 15 forks source link

SyntaxError thrown when no content returned by Keen API #29

Closed tjaneczko closed 6 years ago

tjaneczko commented 6 years ago

Using the Keen.io API to delete a property for an event ( https://keen.io/docs/api/?javascript#delete-a-property ) returns a 204 - No Content result with no data sent (as expected). An attempt is still made to parse the data as JSON ( https://github.com/keen/keen-analysis.js/blob/master/lib/utils/http-server.js#L47 ), which fails and throws a SyntaxError. We are currently working around this issue by catching and ignoring that error, but this is a case that should be handled properly by the http client in keen-analysis.js instead.

Environment: Node v8.9.4

adamkasprowicz commented 6 years ago

Thank you for reporting! This bug is solved by https://github.com/keen/keen-analysis.js/pull/30, we will add this fix to the next realease of the package

adamkasprowicz commented 6 years ago

fixed in 1.3.2