Using a string like this is a cop-out. I plan on changing this before 0.15.
Signed-off-by: Anthony Liguori <aligu...@us.ibm.com> diff --git a/qerror.c b/qerror.c index 5a1e637..c12dd3d 100644 --- a/qerror.c +++ b/qerror.c @@ -145,6 +145,10 @@ static const QErrorStringTable qerror_table[] = { .desc = "Invalid JSON syntax", }, { + .error_fmt = QERR_JSON_PARSE_ERROR, + .desc = "Error parsing JSON: %(message)", + }, + { .error_fmt = QERR_KVM_MISSING_CAP, .desc = "Using KVM without %(capability), %(feature) unavailable", }, diff --git a/qerror.h b/qerror.h index 35e7253..a0fb98d 100644 --- a/qerror.h +++ b/qerror.h @@ -125,6 +125,9 @@ void qerror_set_desc(QError *qerr, const char *fmt); #define QERR_JSON_PARSING \ "{ 'class': 'JSONParsing', 'data': {} }" +#define QERR_JSON_PARSE_ERROR \ + "{ 'class': 'JSONParseError', 'data': { 'message': %s } }" + #define QERR_KVM_MISSING_CAP \ "{ 'class': 'KVMMissingCap', 'data': { 'capability': %s, 'feature': %s } }" -- 1.7.0.4