Skip to content

Commit

Permalink
Reset the error when rcl_take_response failed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Minggang Wang committed Nov 13, 2017
1 parent 15348af commit 27fafbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rclpy/src/rclpy/_rclpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -2186,7 +2186,7 @@ rclpy_take_response(PyObject * Py_UNUSED(self), PyObject * args)
rcl_ret_t ret = rcl_take_response(client, header, taken_response);
PyMem_Free(header);

if (ret != RCL_RET_SERVICE_TAKE_FAILED) {
if (ret == RCL_RET_OK) {
PyObject * pyconvert_to_py = PyObject_GetAttrString(pyresponse_type, "_CONVERT_TO_PY");

typedef PyObject *(* convert_to_py_signature)(void *);
Expand All @@ -2202,7 +2202,7 @@ rclpy_take_response(PyObject * Py_UNUSED(self), PyObject * args)

return pytaken_response;
}
// if take_response failed, just do nothing
rcl_reset_error();
Py_RETURN_NONE;
}

Expand Down

0 comments on commit 27fafbd

Please sign in to comment.