mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-16 03:24:31 +03:00
xenapi: Improve error reporting in xenapiOpen
Use better suited error code and avoid NULL in error messsage as *privP->session->error_description can be NULL.
This commit is contained in:
parent
b8f36e74ad
commit
2682731d24
@ -106,7 +106,7 @@ xenapiOpen (virConnectPtr conn, virConnectAuthPtr auth,
|
||||
}
|
||||
|
||||
if (conn->uri->server == NULL) {
|
||||
xenapiSessionErrorHandler(conn, VIR_ERR_AUTH_FAILED,
|
||||
xenapiSessionErrorHandler(conn, VIR_ERR_INVALID_ARG,
|
||||
_("Server name not in URI"));
|
||||
goto error;
|
||||
}
|
||||
@ -194,7 +194,9 @@ xenapiOpen (virConnectPtr conn, virConnectAuthPtr auth,
|
||||
}
|
||||
|
||||
xenapiSessionErrorHandler(conn, VIR_ERR_AUTH_FAILED,
|
||||
*privP->session->error_description);
|
||||
*privP->session->error_description != NULL ?
|
||||
*privP->session->error_description :
|
||||
_("unknown error"));
|
||||
|
||||
error:
|
||||
VIR_FREE(username);
|
||||
|
Loading…
x
Reference in New Issue
Block a user