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 <[email protected]>
  • Loading branch information
addaleax committed Feb 8, 2019
1 parent 63d398c commit 8b79c15
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 8b79c15

Please sign in to comment.