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

# HCMockResponseSetNetworkErrorCode

> HCMockResponseSetNetworkErrorCode

Set the network error code to return for the mock.

## Syntax

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

### Parameters

*call*   \_In\_\
Type: HCMockCallHandle

The handle of the HTTP call.

*networkErrorCode*   \_In\_\
Type: HRESULT

The network error code of the HTTP call.

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

The platform specific network error code of the HTTP call to be used for logging / debugging.

### Return value

Type: HRESULT

Result code for this API operation. Possible values are S\_OK, E\_INVALIDARG, or E\_FAIL.

## Requirements

**Header:** mock.h

**Library:** libHttpClient.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## See also

[mock](https://docs.xbox.com/reference/live/httpclient/mock/mock_members.md)


## Related topics

- [mock (contents)](https://docs.xbox.com/reference/live/httpclient/mock/mock_members.md)
- [HCMockMatchedCallback](https://docs.xbox.com/reference/live/httpclient/mock/functions/hcmockmatchedcallback.md)
- [HCMockResponseSetStatusCode](https://docs.xbox.com/reference/live/httpclient/mock/functions/hcmockresponsesetstatuscode.md)
- [HCHttpCallResponseSetNetworkErrorCode](https://docs.xbox.com/reference/live/httpclient/httpprovider/functions/hchttpcallresponsesetnetworkerrorcode.md)
- [HCHttpCallResponseSetPlatformNetworkErrorMessage](https://docs.xbox.com/reference/live/httpclient/httpprovider/functions/hchttpcallresponsesetplatformnetworkerrormessage.md)
