]> xenbits.xensource.com Git - libvirt.git/commitdiff
* src/virterror.c: Hugh Brock pointed out that error message
authorDaniel Veillard <veillard@redhat.com>
Fri, 28 Jul 2006 15:10:18 +0000 (15:10 +0000)
committerDaniel Veillard <veillard@redhat.com>
Fri, 28 Jul 2006 15:10:18 +0000 (15:10 +0000)
  for bad argument were wrong and incomplete, this should fix it and
  a few other problems in error reporting
Daniel

ChangeLog
src/virterror.c

index 399d0f5549a743c81a4e359e873f7b20e6408863..98498e2ee7b83b6eaa8a313eaf978451193a6474 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jul 28 16:18:30 CEST 2006 Daniel Veillard <veillard@redhat.com>
+
+       * src/virterror.c: Hugh Brock pointed out that error message
+         for bad argument were wrong and incomplete, this should fix it and
+         a few other problems in error reporting
+
 Mon Jul 24 14:34:15 IST 2006 Mark McLoughlin <markmc@redhat.com>
 
        * libvirt.spec.in: sync changes from fedora CVS
index ded2cce9799a6af54ada9f503203f0378c418c03..6d356928d5327cd78870e2328cbfebef7d9b1ca4 100644 (file)
@@ -387,7 +387,10 @@ __virErrorMsg(virErrorNumber error, const char *info)
             errmsg = "out of memory";
             break;
         case VIR_ERR_NO_SUPPORT:
-            errmsg = "no support for hypervisor %s";
+            if (info != NULL)
+               errmsg = "no support for hypervisor";
+           else
+               errmsg = "no support for hypervisor %s";
             break;
         case VIR_ERR_NO_CONNECT:
             if (info == NULL)
@@ -396,13 +399,22 @@ __virErrorMsg(virErrorNumber error, const char *info)
                 errmsg = "could not connect to %s";
             break;
         case VIR_ERR_INVALID_CONN:
-            errmsg = "invalid connection pointer in";
+            if (info == NULL)
+               errmsg = "invalid connection pointer in";
+           else
+               errmsg = "invalid connection pointer in %s";
             break;
         case VIR_ERR_INVALID_DOMAIN:
-            errmsg = "invalid domain pointer in";
+            if (info == NULL)
+               errmsg = "invalid domain pointer in";
+           else
+               errmsg = "invalid domain pointer in %s";
             break;
         case VIR_ERR_INVALID_ARG:
-            errmsg = "invalid domain pointer in";
+            if (info == NULL)
+               errmsg = "invalid argument in";
+           else
+               errmsg = "invalid argument in %s";
             break;
         case VIR_ERR_OPERATION_FAILED:
             if (info != NULL)
@@ -426,7 +438,10 @@ __virErrorMsg(virErrorNumber error, const char *info)
             errmsg = "got unknown HTTP error code %d";
             break;
         case VIR_ERR_UNKNOWN_HOST:
-            errmsg = "unknown host %s";
+            if (info != NULL)
+               errmsg = "unknown host %s";
+           else
+               errmsg = "unknown host";
             break;
         case VIR_ERR_SEXPR_SERIAL:
             if (info != NULL)