child_process: improve maxBuffer error message

Mention what buffer (stdout, stderr) overflowed.
pull/24503/head
Tom Hughes-Croucher 2011-04-14 16:56:09 -07:00 committed by Ben Noordhuis
parent 20e12e4be3
commit c05f52c254
1 changed files with 2 additions and 2 deletions

View File

@ -574,7 +574,7 @@ exports.execFile = function(file /* args, options, callback */) {
child.stdout.addListener('data', function(chunk) { child.stdout.addListener('data', function(chunk) {
stdout += chunk; stdout += chunk;
if (stdout.length > options.maxBuffer) { if (stdout.length > options.maxBuffer) {
err = new Error('maxBuffer exceeded.'); err = new Error('stdout maxBuffer exceeded.');
kill(); kill();
} }
}); });
@ -582,7 +582,7 @@ exports.execFile = function(file /* args, options, callback */) {
child.stderr.addListener('data', function(chunk) { child.stderr.addListener('data', function(chunk) {
stderr += chunk; stderr += chunk;
if (stderr.length > options.maxBuffer) { if (stderr.length > options.maxBuffer) {
err = new Error('maxBuffer exceeded.'); err = new Error('stderr maxBuffer exceeded.');
kill(); kill();
} }
}); });