From: Peter Krempa Date: Fri, 25 Oct 2024 14:12:50 +0000 (+0200) Subject: virJSONValueFromString: Prefix error message from 'json-c' X-Git-Tag: v10.10.0-rc1~214 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=354a3d2be4c37e9f9732dfb154f31700e27b676f;p=thirdparty%2Flibvirt.git virJSONValueFromString: Prefix error message from 'json-c' The error message from 'json-c' was passed along without any libvirt string which makes it hard to find in the source and isn't exactly clear when present in logs: libvirtd[843]: internal error : invalid utf-8 string Prefix the message with 'failed to parse JSON'. Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrangé --- diff --git a/src/util/virjson.c b/src/util/virjson.c index 42018a98b4..4a95e84f5b 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -1467,7 +1467,8 @@ virJSONValueFromString(const char *jsonstring) jerr = json_tokener_get_error(tok); if (jerr != json_tokener_success) { virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", json_tokener_error_desc(jerr)); + _("failed to parse JSON: %1$s"), + json_tokener_error_desc(jerr)); goto cleanup; } ret = virJSONValueFromJsonC(jobj);