socrata / soda-js

A Javascript-based library for accessing the SODA2 API.
175 stars 48 forks source link

Error handing successful response #12

Closed rhyolight closed 8 years ago

rhyolight commented 9 years ago

Upon inspection, the HTTP request was successful, but this error is thrown anyway:

TypeError: Cannot read property 'ok' of null
    at handler (/Users/mtaylor/dev/river-view/node_modules/soda-js/lib/soda-js.js:200:19)
    at Request.callback (/Users/mtaylor/dev/river-view/node_modules/soda-js/node_modules/superagent/lib/node/index.js:785:12)
    at Stream.<anonymous> (/Users/mtaylor/dev/river-view/node_modules/soda-js/node_modules/superagent/lib/node/index.js:990:12)
    at Stream.emit (events.js:129:20)
    at Unzip.<anonymous> (/Users/mtaylor/dev/river-view/node_modules/soda-js/node_modules/superagent/lib/node/utils.js:108:12)
    at Unzip.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickCallback (node.js:355:11)
rhyolight commented 9 years ago

Anyone monitoring this?

rhyolight commented 8 years ago

Hey @chrismetcalf, we talked on IRC yesterday. What is the status of this API client? I may be using it more in the future.

chrismetcalf commented 8 years ago

@rhyolight Thanks for the PR! The tests were failing and I wanted to make sure they tested cleanly before I merged it. I made a fix to the Producer class and we're good to go now.