From 77145ba22945892a38be53109ed95e04709bfe8e Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sun, 7 Feb 2010 16:51:20 -0800 Subject: [PATCH] Throw errors from server.listen() --- src/node_net.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/node_net.cc b/src/node_net.cc index 5b39ae23bd..dad2906d64 100644 --- a/src/node_net.cc +++ b/src/node_net.cc @@ -821,6 +821,14 @@ Handle Server::Listen(const Arguments& args) { if (address_list) freeaddrinfo(address_list); + if (server->server_.errorno) { + Local e = Exception::Error( + String::NewSymbol(strerror(server->server_.errorno))); + Local obj = e->ToObject(); + obj->Set(String::NewSymbol("errno"), Integer::New(server->server_.errorno)); + return ThrowException(e); + } + return Undefined(); }