Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
os: throw when os.networkInterfaces() fails
Browse files Browse the repository at this point in the history
  • Loading branch information
piscisaureus committed Dec 3, 2012
1 parent 51d5655 commit 03b00dc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/node_os.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,8 @@ static Handle<Value> 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();

Expand Down Expand Up @@ -236,7 +235,7 @@ static Handle<Value> 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);
}
Expand Down

0 comments on commit 03b00dc

Please sign in to comment.