summaryrefslogtreecommitdiff
path: root/src/tty_wrap.cc
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2017-10-27 17:20:54 -0700
committerJames M Snell <jasnell@gmail.com>2017-11-02 11:58:38 -0700
commit3d9d84940ae11a026c8f14e1b502794db7538765 (patch)
tree634619ce40599ea3da38b37398314dfeceecd7cf /src/tty_wrap.cc
parent056b858e57a72c5429d9278bc7b77d1922a2dbe4 (diff)
downloadandroid-node-v8-3d9d84940ae11a026c8f14e1b502794db7538765.tar.gz
android-node-v8-3d9d84940ae11a026c8f14e1b502794db7538765.tar.bz2
android-node-v8-3d9d84940ae11a026c8f14e1b502794db7538765.zip
tty: convert to internal/errors using SystemError
PR-URL: https://github.com/nodejs/node/pull/16567 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'src/tty_wrap.cc')
-rw-r--r--src/tty_wrap.cc7
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();
}