diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2012-07-20 13:43:37 -0300 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2012-08-13 13:20:01 -0300 |
commit | dd7520f0646985b08024c73ba2285c31d7318755 (patch) | |
tree | 89618447aa2859da1b7e32c1b25d2dc323c5e36a /qerror.c | |
parent | 18da7c0f1f24cc00f7c2f80c27cb85e4b234e091 (diff) |
error: don't delay error message construction
Today, the error message is only constructed when it's used. This commit
changes that to construct the error message when the error object is
built (ie. when the error is reported).
This simplifies the Error object.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'qerror.c')
-rw-r--r-- | qerror.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -543,7 +543,6 @@ void qerror_report(const char *fmt, ...) struct Error { QDict *obj; - const char *fmt; char *msg; }; @@ -555,8 +554,7 @@ void qerror_report_err(Error *err) loc_save(&qerr->loc); QINCREF(err->obj); qerr->error = err->obj; - - qerr->err_msg = qerror_format(err->fmt, qerr->error); + qerr->err_msg = g_strdup(err->msg); if (monitor_cur_is_qmp()) { monitor_set_error(cur_mon, qerr); |