zendesk-node-api icon indicating copy to clipboard operation
zendesk-node-api copied to clipboard

Crash when API is unavailable

Open ZufengW opened this issue 8 years ago • 0 comments

For example, if I try to list a ticket while the wifi is off, I get an error:

undefined
^

SyntaxError: Unexpected token u in JSON at position 0
    at Object.parse (native)
    at Request._callback (.../node_modules/zendesk-node-api/src/zdrequest.js:18:23)
    ...

It happens because body has type undefined and JSON tries to parse that.

ZufengW avatar Nov 22 '17 02:11 ZufengW