[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/11] qerror: add JSON parsing error message
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH 06/11] qerror: add JSON parsing error message |
Date: |
Fri, 11 Mar 2011 15:00:44 -0600 |
Using a string like this is a cop-out. I plan on changing this before 0.15.
Signed-off-by: Anthony Liguori <address@hidden>
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
- [Qemu-devel] Re: [PATCH 03/11] add a generic Error object, (continued)
[Qemu-devel] [PATCH 06/11] qerror: add JSON parsing error message,
Anthony Liguori <=
[Qemu-devel] [PATCH 04/11] qerror: split out the reporting bits of QError, Anthony Liguori, 2011/03/11