mckelvey / instagram-node-lib

The Instagram Node Lib is a helper library for node that makes communicating with the Instagram API easy.
http://david.mckelveycreative.com/
Other
303 stars 49 forks source link

Handle 503 errors gracefully #21

Open Robdr opened 10 years ago

Robdr commented 10 years ago

When the Instagram API gives a 503 response (503 Service Unavailable, No server is available to handle this request.) the library now gives the following error: "SyntaxError: Unexpected token < "

Might be nice to handle it more gracefully

despairblue commented 9 years ago

:+1:

papayaah commented 8 years ago

fast forward to 2016 this is still an issue?

despairblue commented 8 years ago

The project hasn't had any commits since then. So I assume that will only have changed if instagram makes sure not to send HTML under any circumstances. I wouldn't trust that.

The status code could be checked to return an error it it isn't 200 and JSON.stringify could be guarded by try-catch.