From: Michael Vogt Date: Wed, 29 Apr 2026 15:52:50 +0000 (+0200) Subject: report: when a report fails, print the json error details X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ffd4e7ab0148f67c685f18c585ac220fa562079b;p=thirdparty%2Fsystemd.git report: when a report fails, print the json error details When a report upload fails the backend often provides useful details via the varlink error. Show them as part of the upload error message. For now we just dump the json because we have no structure that the backends should follow. We may want to consider adding one (like check for an "error_message" key in the json). But for now this is a nice step forward. --- diff --git a/src/report/report-upload.c b/src/report/report-upload.c index fce0c0e5513..471bcb76060 100644 --- a/src/report/report-upload.c +++ b/src/report/report-upload.c @@ -218,7 +218,11 @@ static int execute_dir_reply( if (error_id) { r = sd_varlink_error_to_errno(error_id, reply); RET_GATHER(context->upload_result, r); - return log_error_errno(r, "Upload via Varlink failed: %s", error_id); + log_error_errno(r, "Upload via Varlink failed: %s", error_id); + if (reply) + (void) sd_json_variant_dump(reply, arg_json_format_flags, + /* f= */ NULL, /* prefix= */ NULL); + return r; } printf("Upload via Varlink was successful; reply: ");