diff options
author | micnic <micnic90@gmail.com> | 2015-10-15 00:10:25 +0300 |
---|---|---|
committer | Roman Reiss <me@silverwind.io> | 2015-11-09 20:08:36 +0100 |
commit | 20285ad17755187ece16b8a5effeaa87f5407da2 (patch) | |
tree | fd383b337137f2ab9f1fe51042d29b076f687387 /lib/dgram.js | |
parent | af46112828cb28223050597f06b5e45a659e99d6 (diff) | |
download | android-node-v8-20285ad17755187ece16b8a5effeaa87f5407da2.tar.gz android-node-v8-20285ad17755187ece16b8a5effeaa87f5407da2.tar.bz2 android-node-v8-20285ad17755187ece16b8a5effeaa87f5407da2.zip |
lib: Consistent error messages in all modules
This commit fixes some error messages that are not consistent with
some general rules which most of the error messages follow.
PR-URL: https://github.com/nodejs/node/pull/3374
Reviewed-By: Roman Reiss <me@silverwind.io>
Diffstat (limited to 'lib/dgram.js')
-rw-r--r-- | lib/dgram.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/dgram.js b/lib/dgram.js index eaf84272d1..e172e41324 100644 --- a/lib/dgram.js +++ b/lib/dgram.js @@ -54,7 +54,7 @@ function newHandle(type) { } if (type == 'unix_dgram') - throw new Error('unix_dgram sockets are not supported any more.'); + throw new Error('"unix_dgram" type sockets are not supported any more'); throw new Error('Bad socket type specified. Valid types are: udp4, udp6'); } @@ -233,7 +233,7 @@ Socket.prototype.sendto = function(buffer, address, callback) { if (typeof offset !== 'number' || typeof length !== 'number') - throw new Error('send takes offset and length as args 2 and 3'); + throw new Error('Send takes "offset" and "length" as args 2 and 3'); if (typeof address !== 'string') throw new Error(this.type + ' sockets must send to port, address'); @@ -254,7 +254,7 @@ Socket.prototype.send = function(buffer, buffer = new Buffer(buffer); if (!(buffer instanceof Buffer)) - throw new TypeError('First argument must be a buffer or string.'); + throw new TypeError('First argument must be a buffer or string'); offset = offset | 0; if (offset < 0) @@ -262,7 +262,7 @@ Socket.prototype.send = function(buffer, if ((length == 0 && offset > buffer.length) || (length > 0 && offset >= buffer.length)) - throw new RangeError('Offset into buffer too large'); + throw new RangeError('Offset into buffer is too large'); // Sending a zero-length datagram is kind of pointless but it _is_ // allowed, hence check that length >= 0 rather than > 0. |