|
@ -151,7 +151,7 @@ ResolveA (int type, const Arguments& args) |
|
|
HandleScope scope; |
|
|
HandleScope scope; |
|
|
|
|
|
|
|
|
if (args.Length() == 0 || !args[0]->IsString()) { |
|
|
if (args.Length() == 0 || !args[0]->IsString()) { |
|
|
return ThrowException(String::New("Argument must be a string.")); |
|
|
return ThrowException(Exception::Error(String::New("Argument must be a string."))); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
String::Utf8Value name(args[0]->ToString()); |
|
|
String::Utf8Value name(args[0]->ToString()); |
|
@ -168,7 +168,7 @@ ResolveA (int type, const Arguments& args) |
|
|
break; |
|
|
break; |
|
|
|
|
|
|
|
|
default: |
|
|
default: |
|
|
return ThrowException(String::New("Unsupported type")); |
|
|
return ThrowException(Exception::Error(String::New("Unsupported type"))); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
assert(query); // TODO better error handling.
|
|
|
assert(query); // TODO better error handling.
|
|
@ -230,7 +230,7 @@ Reverse (const Arguments& args) |
|
|
HandleScope scope; |
|
|
HandleScope scope; |
|
|
|
|
|
|
|
|
if (args.Length() == 0 || !args[0]->IsString()) { |
|
|
if (args.Length() == 0 || !args[0]->IsString()) { |
|
|
return ThrowException(String::New("Argument must be a string.")); |
|
|
return ThrowException(Exception::Error(String::New("Argument must be a string."))); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
String::Utf8Value ip_address(args[0]->ToString()); |
|
|
String::Utf8Value ip_address(args[0]->ToString()); |
|
@ -247,7 +247,7 @@ Reverse (const Arguments& args) |
|
|
} else if (dns_pton(AF_INET6, *ip_address, &a.addr6) > 0) { |
|
|
} else if (dns_pton(AF_INET6, *ip_address, &a.addr6) > 0) { |
|
|
v4 = false; |
|
|
v4 = false; |
|
|
} else { |
|
|
} else { |
|
|
return ThrowException(String::New("Invalid IP address")); |
|
|
return ThrowException(Exception::Error(String::New("Invalid IP address"))); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|