Skip to content

If bad JSON comes back from Instagram, any server depending on it crashes #3

Open
wants to merge 1 commit into from

3 participants

@kevinmarks

I caught the exception that JSON.parse throws, which means the server no longer crashes (I think it's an encoding escaping issue on instagram's end, but it was crashing my test server consistently on some tag queries). Feel free to add some better logging to the catch.

@maserg
maserg commented Jan 4, 2014

so, today is a bad day for instagram, and all we got in api answer

 <html>
<head><title>504 Gateway Time-out</title></head>
<body bgcolor="white">
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx</center>
</body>
</html>


undefined:1
<html>
^
SyntaxError: Unexpected token <
    at Object.parse (native)
    at IncomingMessage.<anonymous> (/www/12trip.serg/node_modules/instagram/index.js:38:26)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:920:16
    at process._tickCallback (node.js:415:13)

so pls, apply kevinmarks patch

@joshorig

Hi we're also seeing issues with crashes for instagram incoming data:

/programs/server/npm/instagram-wrapper/main/node_modules/instagram/index.js:35:26)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:920:16
at process._tickCallback (node.js:415:13)

This patch been applied yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.