criso / fbgraph

NodeJs module to access the facebook graph api
http://criso.github.io/fbgraph/
1.09k stars 176 forks source link

"Service Unavailable" string wrongly accepted as valid response #95

Closed watson closed 7 years ago

watson commented 8 years ago

I've just experienced an issue where the json.data property was actually the string "Service Unavailable". Shouldn't this normally have been caught by the module and be returned as a proper error object instead?

criso commented 8 years ago

So it was a 200 with that response? I guess we could check for that string on the response

watson commented 8 years ago

@criso I guess it must have been a 2xx if that's what the module checks for - Unfortunately I don't have a the response so I can't be sure. But in that case it's pretty lousy of facebook to response 200 :(

I think checking for "Service Unavailable" is a bit dodgy though. Maybe there is no good way to do this?

criso commented 7 years ago

Sweet - wasn't checking for statusCode :( I've updated all the things now 1.4.0