[Libvirt-cim] [PATCH] [CU] Add more meaningful return messages to EO parsing functions
Heidi Eckhart
heidieck at linux.vnet.ibm.com
Wed Feb 6 11:22:14 UTC 2008
Kaitlin Rupert wrote:
> # HG changeset patch
> # User Kaitlin Rupert <karupert at us.ibm.com>
> # Date 1202251455 28800
> # Node ID 7cdea1fba87f7aea14d9b4d4543eb3b70d61fe36
> # Parent 1e5195053c3280f2185b98da10c595835eee6233
> [CU] Add more meaningful return messages to EO parsing functions.
>
> Add error messages so that something more descriptive than the generic error message is used.
>
> Signed-off-by: Kaitlin Rupert <karupert at us.ibm.com>
>
> diff -r 1e5195053c32 -r 7cdea1fba87f std_invokemethod.c
> --- a/std_invokemethod.c Tue Jan 29 11:43:44 2008 -0800
> +++ b/std_invokemethod.c Tue Feb 05 14:44:15 2008 -0800
> @@ -55,8 +55,9 @@ static int parse_eo_inst_arg(CMPIString
> str = CMGetCharPtr(string_in);
>
> if (str == NULL) {
> - CMSetStatus(s, CMPI_RC_ERR_INVALID_PARAMETER);
> - CU_DEBUG("Method parameter value is NULL");
> + cu_statusf(broker, s,
> + CMPI_RC_ERR_FAILED,
>
The error code should stay CMPI_RC_ERR_INVALID_PARAMETER
> + "Method parameter value is NULL");
> return 0;
> }
>
> @@ -67,8 +68,9 @@ static int parse_eo_inst_arg(CMPIString
>
> /* cu_parse_embedded_instance() returns 0 on success */
> if ((ret != 0) || CMIsNullObject(instance_out)) {
> - CMSetStatus(s, CMPI_RC_ERR_FAILED);
> - CU_DEBUG("Unable to parse embedded object");
> + cu_statusf(broker, s,
> + CMPI_RC_ERR_FAILED,
> + "Unable to parse embedded object");
> return 0;
> }
>
> @@ -86,8 +88,9 @@ static int parse_eo_array(CMPIArray *str
> int count;
>
> if (CMIsNullObject(strings_in)) {
> - CMSetStatus(s, CMPI_RC_ERR_INVALID_PARAMETER);
> - CU_DEBUG("Method parameter is NULL");
> + cu_statusf(broker, s,
> + CMPI_RC_ERR_FAILED,
>
The same here: CMPI_RC_ERR_INVALID_PARAMETER
> + "Method parameter is NULL");
> return 0;
> }
>
> @@ -146,10 +149,11 @@ static int parse_eo_param(CMPIArgs *args
> broker,
> ns,
> s);
> - } else {
> - CMSetStatus(s, CMPI_RC_ERR_FAILED);
> - CU_DEBUG("Unable to parse argument type %d", type);
> - }
> + } else
> + cu_statusf(broker, s,
> + CMPI_RC_ERR_FAILED,
> + "Unable to parse argument type %d",
> + type);
>
> if (ret != 1)
> return 0;
>
>
thanks
--
Regards
Heidi Eckhart
Software Engineer
IBM Linux Technology Center - Open Hypervisor
More information about the Libvirt-cim
mailing list