SendTo and SendMsg expect a buffer only, not a string; fix the error message. Closes...
authorJoe Shaw <joeshaw@litl.com>
Mon, 27 Jun 2011 17:42:11 +0000 (13:42 -0400)
committerPaul Querna <pquerna@apache.org>
Thu, 7 Jul 2011 04:31:13 +0000 (21:31 -0700)
src/node_net.cc

index a0bda02..22b4e2a 100644 (file)
@@ -1041,7 +1041,7 @@ static Handle<Value> SendMsg(const Arguments& args) {
   // Grab the actul data to be written, stuffing it into iov
   if (!Buffer::HasInstance(args[1])) {
     return ThrowException(Exception::TypeError(
-      String::New("Expected either a string or a buffer")));
+      String::New("Expected a buffer")));
   }
 
   Local<Object> buffer_obj = args[1]->ToObject();
@@ -1167,7 +1167,7 @@ static Handle<Value> SendTo(const Arguments& args) {
   // Grab the actul data to be written
   if (!Buffer::HasInstance(args[1])) {
     return ThrowException(Exception::TypeError(
-      String::New("Expected either a string or a buffer")));
+      String::New("Expected a buffer")));
   }
 
   Local<Object> buffer_obj = args[1]->ToObject();