errors,buffer: port errors to internal/errors

PR-URL: https://github.com/nodejs/node/pull/13976
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
starkwang 2017-06-28 23:58:39 -04:00 committed by Refael Ackermann
parent 1562fb9ea7
commit dbfe8c4ea2
No known key found for this signature in database
GPG key ID: CD704BD80FDDDB64
28 changed files with 342 additions and 143 deletions

View file

@ -54,11 +54,12 @@ assertWrongList(['hello', Buffer.from('world')]);
function assertWrongList(value) {
assert.throws(() => {
Buffer.concat(value);
}, function(err) {
return err instanceof TypeError &&
err.message === '"list" argument must be an Array of Buffer ' +
'or Uint8Array instances';
});
}, common.expectsError({
code: 'ERR_INVALID_ARG_TYPE',
type: TypeError,
message: 'The "list" argument must be one of type ' +
'array, buffer, or uint8Array'
}));
}
const random10 = common.hasCrypto ?