Pomax / node-flickrapi

A node.js (and client-library) implementation of the Flickr API with oauth API key authentication and API method proxying
177 stars 52 forks source link

indexOf body only if body is defined. Fixes #64. #65

Closed neojski closed 9 years ago

neojski commented 9 years ago

I updated the PR. I call the callback now early so that we don't override the error with our No body found in response in case there was an error because most like it's going to be more informative.

Pomax commented 9 years ago

In that case I'd rather keep one callback, and then assign the error as

if(!body) {
  error = error || "No body found in response";
}

So we don't clobber the preexisting error, and we keep the code path a single path.

neojski commented 9 years ago

Done.

Pomax commented 9 years ago

:+1: