diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-10-20 00:57:53 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-10-20 00:57:53 +0900 |
commit | 3d9942de4f13192c010c8d508a7e94556a80e0af (patch) | |
tree | 71b166decd0a093feb737e7df3a752f4cb1e708f /src | |
parent | 7709ef3a70cc228997c93da1eeddb8db16d5906b (diff) | |
download | systemd-3d9942de4f13192c010c8d508a7e94556a80e0af.tar.gz systemd-3d9942de4f13192c010c8d508a7e94556a80e0af.tar.bz2 systemd-3d9942de4f13192c010c8d508a7e94556a80e0af.zip |
busctl: include error cause in log message
Diffstat (limited to 'src')
-rw-r--r-- | src/busctl/busctl.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c index 2f056ac834..9c872ff0aa 100644 --- a/src/busctl/busctl.c +++ b/src/busctl/busctl.c @@ -1356,7 +1356,7 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = parse_boolean(v); if (r < 0) - return log_error_errno(r, "Failed to parse as boolean: %s", v); + return log_error_errno(r, "Failed to parse '%s' as boolean: %m", v); r = sd_bus_message_append_basic(m, t, &r); break; @@ -1366,7 +1366,7 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = safe_atou8(v, &z); if (r < 0) - return log_error_errno(r, "Failed to parse as byte (unsigned 8bit integer): %s", v); + return log_error_errno(r, "Failed to parse '%s' as byte (unsigned 8bit integer): %m", v); r = sd_bus_message_append_basic(m, t, &z); break; @@ -1377,7 +1377,7 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = safe_atoi16(v, &z); if (r < 0) - return log_error_errno(r, "Failed to parse as signed 16bit integer: %s", v); + return log_error_errno(r, "Failed to parse '%s' as signed 16bit integer: %m", v); r = sd_bus_message_append_basic(m, t, &z); break; @@ -1388,7 +1388,7 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = safe_atou16(v, &z); if (r < 0) - return log_error_errno(r, "Failed to parse as unsigned 16bit integer: %s", v); + return log_error_errno(r, "Failed to parse '%s' as unsigned 16bit integer: %m", v); r = sd_bus_message_append_basic(m, t, &z); break; @@ -1399,7 +1399,7 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = safe_atoi32(v, &z); if (r < 0) - return log_error_errno(r, "Failed to parse as signed 32bit integer: %s", v); + return log_error_errno(r, "Failed to parse '%s' as signed 32bit integer: %m", v); r = sd_bus_message_append_basic(m, t, &z); break; @@ -1410,7 +1410,7 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = safe_atou32(v, &z); if (r < 0) - return log_error_errno(r, "Failed to parse as unsigned 32bit integer: %s", v); + return log_error_errno(r, "Failed to parse '%s' as unsigned 32bit integer: %m", v); r = sd_bus_message_append_basic(m, t, &z); break; @@ -1421,7 +1421,7 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = safe_atoi64(v, &z); if (r < 0) - return log_error_errno(r, "Failed to parse as signed 64bit integer: %s", v); + return log_error_errno(r, "Failed to parse '%s' as signed 64bit integer: %m", v); r = sd_bus_message_append_basic(m, t, &z); break; @@ -1432,7 +1432,7 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = safe_atou64(v, &z); if (r < 0) - return log_error_errno(r, "Failed to parse as unsigned 64bit integer: %s", v); + return log_error_errno(r, "Failed to parse '%s' as unsigned 64bit integer: %m", v); r = sd_bus_message_append_basic(m, t, &z); break; @@ -1443,7 +1443,7 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = safe_atod(v, &z); if (r < 0) - return log_error_errno(r, "Failed to parse as double precision floating point: %s", v); + return log_error_errno(r, "Failed to parse '%s' as double precision floating point: %m", v); r = sd_bus_message_append_basic(m, t, &z); break; @@ -1462,11 +1462,11 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = safe_atou32(v, &n); if (r < 0) - return log_error_errno(r, "Failed to parse number of array entries: %s", v); + return log_error_errno(r, "Failed to parse '%s' number of array entries: %m", v); r = signature_element_length(signature, &k); if (r < 0) - return log_error_errno(r, "Invalid array signature."); + return log_error_errno(r, "Invalid array signature: %m"); { unsigned i; @@ -1512,7 +1512,7 @@ static int message_append_cmdline(sd_bus_message *m, const char *signature, char r = signature_element_length(signature, &k); if (r < 0) - return log_error_errno(r, "Invalid struct/dict entry signature."); + return log_error_errno(r, "Invalid struct/dict entry signature: %m"); { char s[k-1]; @@ -2285,7 +2285,7 @@ static int parse_argv(int argc, char *argv[]) { r = parse_size(optarg, 1024, &sz); if (r < 0) - return log_error_errno(r, "Failed to parse size: %s", optarg); + return log_error_errno(r, "Failed to parse size '%s': %m", optarg); if ((uint64_t) (size_t) sz != sz) { log_error("Size out of range."); @@ -2321,7 +2321,7 @@ static int parse_argv(int argc, char *argv[]) { case ARG_EXPECT_REPLY: r = parse_boolean(optarg); if (r < 0) - return log_error_errno(r, "Failed to parse --expect-reply= parameter: %s", optarg); + return log_error_errno(r, "Failed to parse --expect-reply= parameter '%s': %m", optarg); arg_expect_reply = r; break; @@ -2329,7 +2329,7 @@ static int parse_argv(int argc, char *argv[]) { case ARG_AUTO_START: r = parse_boolean(optarg); if (r < 0) - return log_error_errno(r, "Failed to parse --auto-start= parameter: %s", optarg); + return log_error_errno(r, "Failed to parse --auto-start= parameter '%s': %m", optarg); arg_auto_start = r; break; @@ -2337,7 +2337,7 @@ static int parse_argv(int argc, char *argv[]) { case ARG_ALLOW_INTERACTIVE_AUTHORIZATION: r = parse_boolean(optarg); if (r < 0) - return log_error_errno(r, "Failed to parse --allow-interactive-authorization= parameter: %s", optarg); + return log_error_errno(r, "Failed to parse --allow-interactive-authorization= parameter '%s': %m", optarg); arg_allow_interactive_authorization = r; break; @@ -2345,14 +2345,14 @@ static int parse_argv(int argc, char *argv[]) { case ARG_TIMEOUT: r = parse_sec(optarg, &arg_timeout); if (r < 0) - return log_error_errno(r, "Failed to parse --timeout= parameter: %s", optarg); + return log_error_errno(r, "Failed to parse --timeout= parameter '%s': %m", optarg); break; case ARG_AUGMENT_CREDS: r = parse_boolean(optarg); if (r < 0) - return log_error_errno(r, "Failed to parse --augment-creds= parameter: %s", optarg); + return log_error_errno(r, "Failed to parse --augment-creds= parameter '%s': %m", optarg); arg_augment_creds = r; break; @@ -2360,7 +2360,7 @@ static int parse_argv(int argc, char *argv[]) { case ARG_WATCH_BIND: r = parse_boolean(optarg); if (r < 0) - return log_error_errno(r, "Failed to parse --watch-bind= parameter: %s", optarg); + return log_error_errno(r, "Failed to parse --watch-bind= parameter '%s': %m", optarg); arg_watch_bind = r; break; |