Skip to content

Commit

Permalink
Use CamelCase instead of snake_case in exception names
Browse files Browse the repository at this point in the history
Signed-off-by: ivanpauno <[email protected]>
  • Loading branch information
ivanpauno committed Sep 16, 2019
1 parent 666c421 commit 0a4fe6f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions rclpy/src/rclpy/_rclpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

static PyObject * RCLInvalidROSArgsError;
static PyObject * UnknownROSArgsError;
static PyObject * _rclpy_node_name_non_existent_error;
static PyObject * NodeNameNonExistentError;

void
_rclpy_context_capsule_destructor(PyObject * capsule)
Expand Down Expand Up @@ -3216,7 +3216,7 @@ rclpy_get_service_names_and_types_by_node(PyObject * Py_UNUSED(self), PyObject *
if (ret != RCL_RET_OK) {
PyObject * error = PyExc_RuntimeError;
if (ret == RCL_RET_NODE_NAME_NON_EXISTENT) {
error = _rclpy_node_name_non_existent_error;
error = NodeNameNonExistentError;
}
PyErr_Format(error,
"Failed to get_service_names_and_types: %s", rcl_get_error_string().str);
Expand Down Expand Up @@ -3268,7 +3268,7 @@ rclpy_get_client_names_and_types_by_node(PyObject * Py_UNUSED(self), PyObject *
if (ret != RCL_RET_OK) {
PyObject * error = PyExc_RuntimeError;
if (ret == RCL_RET_NODE_NAME_NON_EXISTENT) {
error = _rclpy_node_name_non_existent_error;
error = NodeNameNonExistentError;
}
PyErr_Format(error,
"Failed to get_client_names_and_types: %s", rcl_get_error_string().str);
Expand Down Expand Up @@ -3322,7 +3322,7 @@ rclpy_get_subscriber_names_and_types_by_node(PyObject * Py_UNUSED(self), PyObjec
if (ret != RCL_RET_OK) {
PyObject * error = PyExc_RuntimeError;
if (ret == RCL_RET_NODE_NAME_NON_EXISTENT) {
error = _rclpy_node_name_non_existent_error;
error = NodeNameNonExistentError;
}
PyErr_Format(error,
"Failed to get_subscriber_names_and_types: %s", rcl_get_error_string().str);
Expand Down Expand Up @@ -3375,7 +3375,7 @@ rclpy_get_publisher_names_and_types_by_node(PyObject * Py_UNUSED(self), PyObject
if (ret != RCL_RET_OK) {
PyObject * error = PyExc_RuntimeError;
if (ret == RCL_RET_NODE_NAME_NON_EXISTENT) {
error = _rclpy_node_name_non_existent_error;
error = NodeNameNonExistentError;
}
PyErr_Format(error,
"Failed to get_publisher_names_and_types: %s", rcl_get_error_string().str);
Expand Down Expand Up @@ -5096,11 +5096,11 @@ PyMODINIT_FUNC PyInit__rclpy(void)
return NULL;
}

_rclpy_node_name_non_existent_error = PyErr_NewExceptionWithDoc(
NodeNameNonExistentError = PyErr_NewExceptionWithDoc(
"_rclpy.NodeNameNonExistentError",
"Thrown when a node name is not found.",
PyExc_RuntimeError, NULL);
if (PyModule_AddObject(m, "NodeNameNonExistentError", _rclpy_node_name_non_existent_error)) {
if (PyModule_AddObject(m, "NodeNameNonExistentError", NodeNameNonExistentError)) {
Py_DECREF(m);
return NULL;
}
Expand Down

0 comments on commit 0a4fe6f

Please sign in to comment.