adamcoulombe/node-imgur-upload — pull request #1 by iamdenny (2013-05-29 01:47:30+00:00)
Title: I got an error

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, api.imgur.com/3/upload doesn't give us the result as JSON. It give us as HTML.
Like this,
-----

413 Request Entity Too Large

413 Request Entity Too Large

nginx

-----

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. (/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. (/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.