Skip to content

Commit 618bd73

Browse files
committed
Socket::Close: Don't throw a C++ exception
1 parent 6f3e5e2 commit 618bd73

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

binding.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,8 +1400,10 @@ namespace zmq {
14001400
void
14011401
Socket::Close() {
14021402
if (socket_) {
1403-
if (zmq_close(socket_) < 0)
1404-
throw std::runtime_error(ErrorMessage());
1403+
if (zmq_close(socket_) < 0) {
1404+
Nan::ThrowError(ErrorMessage());
1405+
return;
1406+
}
14051407
socket_ = NULL;
14061408
state_ = STATE_CLOSED;
14071409
context_.Reset();

0 commit comments

Comments
 (0)