mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
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 <pkrempa@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
e71a510605
commit
354a3d2be4
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user