instagram-node-lib icon indicating copy to clipboard operation
instagram-node-lib copied to clipboard

Handle 503 errors gracefully

Open Robdr opened this issue 11 years ago • 3 comments

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

Robdr avatar Nov 06 '13 21:11 Robdr

:+1:

despairblue avatar Sep 23 '14 20:09 despairblue

fast forward to 2016 this is still an issue?

papayaah avatar Feb 07 '16 06:02 papayaah

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.

despairblue avatar Feb 08 '16 09:02 despairblue