Skip to content

Commit 6f20cd9

Browse files
mikaelarguedasdirk-thomas
authored andcommitted
Improve security error messages (ros2#480)
* Prints the node name when failing to find security directory Also quotes directory, node_name and lookup strategy in error message for readability Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com> * don't quote lookup strategy Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com> * newline -> whitespace Signed-off-by: Mikael Arguedas <mikael.arguedas@gmail.com>
1 parent 5f1e543 commit 6f20cd9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rcl/src/rcl/security_directory.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,12 @@ char * rcl_get_secure_root(
247247
// Check node_secure_root is not NULL before checking directory
248248
if (NULL == node_secure_root) {
249249
RCL_SET_ERROR_MSG_WITH_FORMAT_STRING(
250-
"SECURITY ERROR: unable to find a folder matching the node name in %s%s."
250+
"SECURITY ERROR: unable to find a folder matching the node name '%s' in '%s%s'. "
251251
"Lookup strategy: %s",
252-
ros_secure_root_env, node_namespace, lookup_strategy);
252+
node_name, ros_secure_root_env, node_namespace, lookup_strategy);
253253
} else {
254254
RCL_SET_ERROR_MSG_WITH_FORMAT_STRING(
255-
"SECURITY ERROR: directory %s does not exist. Lookup strategy: %s",
255+
"SECURITY ERROR: directory '%s' does not exist. Lookup strategy: %s",
256256
node_secure_root, lookup_strategy);
257257
}
258258
allocator->deallocate(ros_secure_root_env, allocator->state);

0 commit comments

Comments
 (0)