> ## 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

設定模擬要傳回的網路錯誤碼。

## 語法

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

### 參數

*call*   \_In\_\
類型：HCMockCallHandle

HTTP 呼叫的控制代碼。

*networkErrorCode*   \_In\_\
類型：HRESULT

HTTP 呼叫的網路錯誤碼。

*platformNetworkErrorCode*   \_In\_\
類型：uint32\_t

用於記錄 / 偵錯之 HTTP 呼叫的平台特定網路錯誤碼。

### 傳回值

類型：HRESULT

此 API 作業的結果代碼。可能的值為 S\_OK、E\_INVALIDARG 或 E\_FAIL。

## 需求

**標頭：** mock.h

**程式庫：** libHttpClient.GDK.lib

## 另請參閱

[mock](/zh-TW/reference/live/httpclient/mock/mock_members)


## Related topics

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