instagram-node-lib
instagram-node-lib copied to clipboard
Handle 503 errors gracefully
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
:+1:
fast forward to 2016 this is still an issue?
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.