Skip to content

Commit

Permalink
src: pass along errors from StreamBase req obj creations
Browse files Browse the repository at this point in the history
PR-URL: #25822
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
  • Loading branch information
addaleax committed Feb 8, 2019
1 parent d6f3b87 commit 469cdac
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/stream_base-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,11 @@ inline int StreamBase::Shutdown(v8::Local<v8::Object> req_wrap_obj) {
HandleScope handle_scope(env->isolate());

if (req_wrap_obj.IsEmpty()) {
req_wrap_obj =
env->shutdown_wrap_template()
->NewInstance(env->context()).ToLocalChecked();
if (!env->shutdown_wrap_template()
->NewInstance(env->context())
.ToLocal(&req_wrap_obj)) {
return UV_EBUSY;
}
StreamReq::ResetObject(req_wrap_obj);
}

Expand Down Expand Up @@ -211,9 +213,11 @@ inline StreamWriteResult StreamBase::Write(
HandleScope handle_scope(env->isolate());

if (req_wrap_obj.IsEmpty()) {
req_wrap_obj =
env->write_wrap_template()
->NewInstance(env->context()).ToLocalChecked();
if (!env->write_wrap_template()
->NewInstance(env->context())
.ToLocal(&req_wrap_obj)) {
return StreamWriteResult { false, UV_EBUSY, nullptr, 0 };
}
StreamReq::ResetObject(req_wrap_obj);
}

Expand Down

0 comments on commit 469cdac

Please sign in to comment.