> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# HCMockResponseSetNetworkErrorCode

> HCMockResponseSetNetworkErrorCode

# HCMockResponseSetNetworkErrorCode

设置为该模拟返回的网络错误代码。

## Syntax

```cpp theme={null}
HRESULT HCMockResponseSetNetworkErrorCode(  
         HCMockCallHandle call,  
         HRESULT networkErrorCode,  
         uint32_t platformNetworkErrorCode  
)  
```

### Parameters

*call*   \_In\_\
Type: HCMockCallHandle

HTTP 调用的句柄。

*networkErrorCode*   \_In\_\
Type: HRESULT

HTTP 调用的网络错误代码。

*platformNetworkErrorCode*   \_In\_\
Type: uint32\_t

HTTP 调用特定于平台的网络错误代码，用于日志记录 / 调试。

### Return value

Type: HRESULT

此 API 操作的结果代码。可能的值为 S\_OK、E\_INVALIDARG 或 E\_FAIL。

## Requirements

**Header:** mock.h

**Library:** libHttpClient.GDK.lib

## See also

[mock](/reference/live/httpclient/mock/mock_members)


## Related topics

- [HCMockResponseSetStatusCode](/zh-CN/reference/live/httpclient/mock/functions/hcmockresponsesetstatuscode.md)
- [HCHttpCallResponseSetNetworkErrorCode](/zh-CN/reference/live/httpclient/httpprovider/functions/hchttpcallresponsesetnetworkerrorcode.md)
- [HCHttpCallResponseGetNetworkErrorCode](/zh-CN/reference/live/httpclient/httpclient/functions/hchttpcallresponsegetnetworkerrorcode.md)
- [HCHttpCallResponseSetPlatformNetworkErrorMessage](/zh-CN/reference/live/httpclient/httpprovider/functions/hchttpcallresponsesetplatformnetworkerrormessage.md)
- [HCMockResponseSetHeader](/zh-CN/reference/live/httpclient/mock/functions/hcmockresponsesetheader.md)
