max-buffer-exceeded-error
v1.0.1
Published
A better error class for 'maxBuffer exceeded' errors
Downloads
240
Maintainers
Readme
max-buffer-exceeded-error
A better Error
class for "maxBuffer exceeded" errors
const {execFile} = require('child_process');
execFile('npm', {maxBuffer: 10}, err => {
err; //=> Error: stdout maxBuffer exceeded
});
const MaxBufferExceededError = require('max-buffer-exceeded-error');
new MaxBufferExceededError('stdout', 10);
/*
=> { [MaxBufferExceededError: stdout maxBuffer exceeded. (>10)]
message: 'stdout maxBuffer exceeded. (>10)',
maxBuffer: 10 }
*/
Installation
npm install max-buffer-exceeded-error
API
const MaxBufferExceededError = require('max-buffer-exceeded-error');
new MaxBufferExceededError(name. maxBuffer)
name: String
(a name of what limits the buffer size e.g. stdout
, stderr
)
maxBuffer: number
(size of the max buffer)
Return: MaxBufferExceededError
instance
License
Copyright (c) 2015 Shinnosuke Watanabe
Licensed under the MIT License.