diff options
author | Darshan Sen <raisinten@gmail.com> | 2022-03-26 18:39:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-26 18:39:59 +0300 |
commit | bc395d4c53afaaa53f9088b90ae84249adbf4d2e (patch) | |
tree | e581017fa3b67e3e4fd30dd9646fd177a9e2d44b /src/tcp_wrap.cc | |
parent | 99c46a62dae50e10f63e22f6becba99e56ffe975 (diff) |
src: properly report exceptions from AddressToJS()
Signed-off-by: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/42054
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'src/tcp_wrap.cc')
-rw-r--r-- | src/tcp_wrap.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc index 669206fc6bf..538f0355491 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -342,9 +342,9 @@ void TCPWrap::Connect(const FunctionCallbackInfo<Value>& args, // also used by udp_wrap.cc -Local<Object> AddressToJS(Environment* env, - const sockaddr* addr, - Local<Object> info) { +MaybeLocal<Object> AddressToJS(Environment* env, + const sockaddr* addr, + Local<Object> info) { EscapableHandleScope scope(env->isolate()); char ip[INET6_ADDRSTRLEN + UV_IF_NAMESIZE]; const sockaddr_in* a4; @@ -371,8 +371,7 @@ Local<Object> AddressToJS(Environment* env, &scopeidlen); if (r) { env->ThrowUVException(r, "uv_if_indextoiid"); - // TODO(addaleax): Do proper MaybeLocal handling here - return scope.Escape(info); + return {}; } } port = ntohs(a6->sin6_port); |