ChildProcess::Spawn (const Arguments& args)
{
if (args.Length() == 0 || !args[0]->IsString()) {
- return ThrowException(String::New("Bad argument."));
+ return ThrowException(Exception::Error(String::New("Bad argument.")));
}
HandleScope scope;
int r = child->Spawn(*command);
if (r != 0) {
- return ThrowException(String::New("Error spawning"));
+ return ThrowException(Exception::Error(String::New("Error spawning")));
}
child->handle_->Set(PID_SYMBOL, Integer::New(child->pid_));
if (args[0]->IsInt32()) sig = args[0]->Int32Value();
if (child->Kill(sig) != 0) {
- return ThrowException(String::New("ChildProcess already dead"));
+ return ThrowException(Exception::Error(String::New("ChildProcess already dead")));
}
return Undefined();
HandleScope scope;
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());
break;
default:
- return ThrowException(String::New("Unsupported type"));
+ return ThrowException(Exception::Error(String::New("Unsupported type")));
}
assert(query); // TODO better error handling.
HandleScope scope;
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());
} else if (dns_pton(AF_INET6, *ip_address, &a.addr6) > 0) {
v4 = false;
} else {
- return ThrowException(String::New("Invalid IP address"));
+ return ThrowException(Exception::Error(String::New("Invalid IP address")));
}
}
assert(0 && "This shouldnt happen");
- return ThrowException(String::New("This shouldn't happen."));
+ return ThrowException(Exception::Error(String::New("This shouldn't happen.")));
}
void
HandleScope scope;
if (stdin_fd >= 0) {
- return ThrowException(String::New("stdin already open"));
+ return ThrowException(Exception::Error(String::New("stdin already open")));
}
stdin_encoding = UTF8;
HandleScope scope;
if (stdin_fd < 0) {
- return ThrowException(String::New("stdin not open"));
+ return ThrowException(Exception::Error(String::New("stdin not open")));
}
evcom_reader_close(&in);