Skip to content

Commit b660215

Browse files
author
Minggang Wang
committed
Reset the error status
We must reset the error status to avoid being overwritten by the next one. Calling rcl_reset_error() will meet this when an error happens during taking an response from service. Fix #144
1 parent 5acfd2c commit b660215

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/rcl_bindings.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,12 @@ NAN_METHOD(RclTakeResponse) {
317317
void* taken_response = node::Buffer::Data(info[2]->ToObject());
318318
rcl_ret_t ret = rcl_take_response(client, header, taken_response);
319319

320-
if (ret != RCL_RET_CLIENT_TAKE_FAILED) {
320+
if (ret == RCL_RET_OK) {
321321
info.GetReturnValue().Set(Nan::True());
322322
return;
323323
}
324324

325+
rcl_reset_error();
325326
info.GetReturnValue().Set(Nan::False());
326327
}
327328

0 commit comments

Comments
 (0)