# Name

VixJob_GetError

# Description

    VixError
    VixJob_GetError(VixHandle jobHandle);

Retrieves the error code from a job that has completed.

# Parameters

jobHandle
  The handle of a job object, returned from any asynchronous Vix function.

# Return Value

VixError. The result returned by a completed asynchronous function.

# Remarks

- Applications should call this function only after an asynchronous job has completed.
- The error code returned by this function is the same as the error code returned by VixJob_Wait().

# Side Effects

None.

# Requirements

vix.h, since VMware Server 1.0.

# Example

    VixError err = VIX_OK;
    VixHandle hostHandle = VIX_INVALID_HANDLE;
    VixHandle jobHandle = VIX_INVALID_HANDLE;

    jobHandle = VixHost_Connect(VIX_API_VERSION,
                                VIX_SERVICEPROVIDER_VMWARE_WORKSTATION,
                                NULL, // hostName
                                0, // hostPort
                                NULL, // userName
                                NULL, // password,
                                0, // options
                                VIX_INVALID_HANDLE, // propertyListHandle
                                NULL, // callbackProc
                                NULL); // clientData
                                VixJob_Wait(jobHandle, VIX_PROPERTY_NONE);

    err = VixJob_GetError(jobHandle);
    if (VIX_OK != err) {
       // Handle the error...
       goto abort;
    }

    abort:
    Vix_ReleaseHandle(jobHandle);
    VixHost_Disconnect(hostHandle);

Copyright (C) 2007-2018 VMware, Inc. All rights reserved.