WsCreateError function (webservices.h)

Creates an error object that can passed to functions to record rich error information.

Syntax

HRESULT WsCreateError(
       const WS_ERROR_PROPERTY *properties,
  [in] ULONG                   propertyCount,
       WS_ERROR                **error
);

Parameters

properties

An array of WS_ERROR_PROPERTY structures containing optional error properties.

[in] propertyCount

The number of properties in the properties array.

error

On success, a pointer that receives the address of the WS_ERROR structure representing the created error object.

Return value

If the function succeeds, it returns NO_ERROR; otherwise, it returns an HRESULT error code.

Return code Description
E_INVALIDARG
One or more arguments are invalid.
E_OUTOFMEMORY
Insufficient memory to complete the operation.
Other Errors
This function may return other errors not listed above.

Remarks

When you no long need the error object, free it by calling the WsFreeError function.

By default, the language of any language-dependent information in the error object is the current user default UI language. However, you can change the language by setting the WS_ERROR_PROPERTY_LANGID property. See the WS_ERROR_PROPERTY_ID enumeration.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header webservices.h
Library WebServices.lib
DLL WebServices.dll