From 6f20cd9480ad1f7d47e716df8e50b7806dadd8ab Mon Sep 17 00:00:00 2001 From: Mikael Arguedas Date: Sat, 3 Aug 2019 01:36:44 +0200 Subject: [PATCH] Improve security error messages (#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 * don't quote lookup strategy Signed-off-by: Mikael Arguedas * newline -> whitespace Signed-off-by: Mikael Arguedas --- rcl/src/rcl/security_directory.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rcl/src/rcl/security_directory.c b/rcl/src/rcl/security_directory.c index 6e7d9f54e..b4e0fdb6a 100644 --- a/rcl/src/rcl/security_directory.c +++ b/rcl/src/rcl/security_directory.c @@ -247,12 +247,12 @@ char * rcl_get_secure_root( // Check node_secure_root is not NULL before checking directory if (NULL == node_secure_root) { RCL_SET_ERROR_MSG_WITH_FORMAT_STRING( - "SECURITY ERROR: unable to find a folder matching the node name in %s%s." + "SECURITY ERROR: unable to find a folder matching the node name '%s' in '%s%s'. " "Lookup strategy: %s", - ros_secure_root_env, node_namespace, lookup_strategy); + node_name, ros_secure_root_env, node_namespace, lookup_strategy); } else { RCL_SET_ERROR_MSG_WITH_FORMAT_STRING( - "SECURITY ERROR: directory %s does not exist. Lookup strategy: %s", + "SECURITY ERROR: directory '%s' does not exist. Lookup strategy: %s", node_secure_root, lookup_strategy); } allocator->deallocate(ros_secure_root_env, allocator->state);