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

I got an error #1

merged 1 commit into from May 29, 2013


None yet
3 participants

iamdenny commented May 29, 2013

Hi, I am Denny.
I'm using the node-imgur-upload module as well.
but I found an error while uploading image.
When I upload big file such as 20MB image, doesn't give us the result as JSON. It give us as HTML.
Like this,

<head><title>413 Request Entity Too Large</title></head>
<body bgcolor="white">
<center><h1>413 Request Entity Too Large</h1></center>

your module do like this,
_cb(err, JSON.parse(body));
so when try to JSON.parse(body), it will be error like this,

SyntaxError: Unexpected token <
    at Object.parse (native)
    at Request._callback (/Users/nhn/Documents/workspace/lolol/trunk/image.uploader/node_modules/imgur-upload/lib/imgur-upload.js:29:19)
    at Request.self.callback (/Users/nhn/Documents/workspace/lolol/trunk/image.uploader/node_modules/imgur-upload/node_modules/request/index.js:142:22)
    at Request.EventEmitter.emit (events.js:98:17)
    at Request.<anonymous> (/Users/nhn/Documents/workspace/lolol/trunk/image.uploader/node_modules/imgur-upload/node_modules/request/index.js:856:14)
    at Request.EventEmitter.emit (events.js:117:20)
    at IncomingMessage.<anonymous> (/Users/nhn/Documents/workspace/lolol/trunk/image.uploader/node_modules/imgur-upload/node_modules/request/index.js:808:12)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:895:16
    at process._tickCallback (node.js:415:13)

I changed the code that I'm thinking right.
please check it out and modify it.

Thank you.

adamcoulombe added a commit that referenced this pull request May 29, 2013

Merge pull request #1 from iamdenny/master
Catch non-JSON response when API is overloaded

@adamcoulombe adamcoulombe merged commit 3cc4852 into adamcoulombe:master May 29, 2013


This comment has been minimized.

Show comment
Hide comment

kimshinelove commented May 30, 2013



This comment has been minimized.

Show comment
Hide comment

iamdenny May 31, 2013


Can you please update the lastest code to NPM?


iamdenny commented May 31, 2013

Can you please update the lastest code to NPM?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment