eric-at-nocoast/zendesk-node-api

Crash when API is unavailable

ZufengW opened this issue · 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.