src: turn uv_pipe_open() failures into exceptions
uv_pipe_open() is unlikely to fail but when it does, the failure should not be quietly ignored. Raise the error as an exception. See joyent/libuv#941.
This commit is contained in:
parent
671b5be6e9
commit
994ce4c99f
@ -269,9 +269,10 @@ Handle<Value> PipeWrap::Open(const Arguments& args) {
|
|||||||
|
|
||||||
UNWRAP(PipeWrap)
|
UNWRAP(PipeWrap)
|
||||||
|
|
||||||
int fd = args[0]->IntegerValue();
|
if (uv_pipe_open(&wrap->handle_, args[0]->Int32Value())) {
|
||||||
|
uv_err_t err = uv_last_error(wrap->handle_.loop);
|
||||||
uv_pipe_open(&wrap->handle_, fd);
|
return ThrowException(UVException(err.code, "uv_pipe_open"));
|
||||||
|
}
|
||||||
|
|
||||||
return scope.Close(v8::Null());
|
return scope.Close(v8::Null());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user