{"action":"closed","issue":{"url":"https://api.github.com/repos/mscdex/busboy/issues/76","labels_url":"https://api.github.com/repos/mscdex/busboy/issues/76/labels{/name}","comments_url":"https://api.github.com/repos/mscdex/busboy/issues/76/comments","events_url":"https://api.github.com/repos/mscdex/busboy/issues/76/events","html_url":"https://github.com/mscdex/busboy/issues/76","id":69259420,"number":76,"title":"busboy doesn't error when over limit?","user":{"login":"canebat","id":11918212,"avatar_url":"https://avatars.githubusercontent.com/u/11918212?v=3","gravatar_id":"","url":"https://api.github.com/users/canebat","html_url":"https://github.com/canebat","followers_url":"https://api.github.com/users/canebat/followers","following_url":"https://api.github.com/users/canebat/following{/other_user}","gists_url":"https://api.github.com/users/canebat/gists{/gist_id}","starred_url":"https://api.github.com/users/canebat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/canebat/subscriptions","organizations_url":"https://api.github.com/users/canebat/orgs","repos_url":"https://api.github.com/users/canebat/repos","events_url":"https://api.github.com/users/canebat/events{/privacy}","received_events_url":"https://api.github.com/users/canebat/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-18T02:53:52Z","updated_at":"2015-04-18T03:34:34Z","closed_at":"2015-04-18T03:34:34Z","body":"I've got a busboy with options:\r\n```\r\nvar busboyParser = busboy({\r\n    limits: {\r\n        fileSize: 1000000,       // 1 mb\r\n        files: 2,\r\n    }\r\n});\r\n```\r\nMy code is basically from the README:\r\n```\r\n    if (req.busboy) {\r\n        req.busboy.on('file', function(fieldname, file, filename, encoding, mimetype) {\r\n            var saveTo = path.join(os.tmpDir(), path.basename(fieldname));\r\n            console.log(\"saved to \" + saveTo);\r\n            file.resume();\r\n        });\r\n        req.busboy.on('field', function(fieldname, val, fieldnameTruncated, valTruncated) {\r\n            console.log('Field [' + fieldname + ']: value: ' + val);\r\n        });\r\n        req.busboy.on('finish', function() {\r\n            console.log('Done parsing form!');\r\n        });\r\n        req.busboy.on('error', function() {\r\n            console.log(\"ERROR\");\r\n        });\r\n        req.pipe(req.busboy);\r\n    }\r\n```\r\n\r\nBut if I upload a file that's over 1MB or upload more than 2 files, busboy won't throw any errors. Instead  busboy just proceeds to process the file(s):\r\n```\r\nField [flowChunkNumber]: value: 3\r\nField [flowChunkSize]: value: 1048576\r\nField [flowCurrentChunkSize]: value: 1048576\r\nField [flowTotalSize]: value: 8210139\r\nField [flowIdentifier]: value: 8210139-guidepdf\r\nField [flowFilename]: value: guide.pdf\r\nField [flowRelativePath]: value: guide.pdf\r\nField [flowTotalChunks]: value: 7\r\nsaved to /tmp/file\r\nDone parsing form!\r\n```\r\n\r\nHow should I handle errors relating to the defined limits?"}}