diff options
Diffstat (limited to 'src/tty_wrap.cc')
-rw-r--r-- | src/tty_wrap.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc index 872a126c6d..4d49e1a65c 100644 --- a/src/tty_wrap.cc +++ b/src/tty_wrap.cc @@ -154,9 +154,10 @@ void TTYWrap::New(const FunctionCallbackInfo<Value>& args) { int err = 0; TTYWrap* wrap = new TTYWrap(env, args.This(), fd, args[1]->IsTrue(), &err); - if (err != 0) - return env->ThrowUVException(err, "uv_tty_init"); - + if (err != 0) { + env->CollectUVExceptionInfo(args[2], err, "uv_tty_init"); + args.GetReturnValue().SetUndefined(); + } wrap->UpdateWriteQueueSize(); } |