Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kevinmarks
Copy link

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
Copy link

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
Copy link

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants