From 03b00dcca912ae2dba515fb05221f2245e829479 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Mon, 3 Dec 2012 22:34:27 +0100 Subject: [PATCH] os: throw when os.networkInterfaces() fails --- src/node_os.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/node_os.cc b/src/node_os.cc index af363d33a5..d6ac915723 100644 --- a/src/node_os.cc +++ b/src/node_os.cc @@ -206,9 +206,8 @@ static Handle GetInterfaceAddresses(const Arguments& args) { uv_err_t err = uv_interface_addresses(&interfaces, &count); - if (err.code != UV_OK) { - return Undefined(); - } + if (err.code != UV_OK) + return ThrowException(UVException(err.code, "uv_interface_addresses")); ret = Object::New(); @@ -236,7 +235,7 @@ static Handle GetInterfaceAddresses(const Arguments& args) { o->Set(String::New("address"), String::New(ip)); o->Set(String::New("family"), family); o->Set(String::New("internal"), interfaces[i].is_internal ? - True() : False()); + True() : False()); ifarr->Set(ifarr->Length(), o); }