# Handling Network Error

**URL:** <https://forums.unrealengine.com/t/handling-network-error/363282>\
**Category:** Multiplayer & Networking\
**Tags:** Networking, gameinstance, unreal-engine, Multiplayer, question\
**Created:** [July 7, 2016, 7:02pm UTC](https://forums.unrealengine.com/t/handling-network-error/363282 "2016-07-07T19:02:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_61dd924d1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_61dd924d1](https://forums.unrealengine.com/u/anonymous_user_61dd924d1)\
**Post date:** [July 7, 2016, 7:02pm UTC](https://forums.unrealengine.com/t/handling-network-error/363282/1 "2016-07-07T19:02:11Z")

</div>

Hello, I am starting to study c++ multiplayer part and my question is:  
How to handle network errors in c++ using the gameinstance?  
I know that on blueprints we have the event handleNetworkError.

Thanks.

---

<div class="post-metadata">

**Author:** ![Koo294](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Koo294](https://forums.unrealengine.com/u/Koo294)\
**Post date:** [July 31, 2016, 11:46am UTC](https://forums.unrealengine.com/t/handling-network-error/363282/2 "2016-07-31T11:46:31Z")

</div>

Something like this worked for me:

Make a function like this in your GameInstance class:

```
void HandleNetworkFailure(UWorld * World, UNetDriver * NetDriver, ENetworkFailure::Type FailureType, const FString & ErrorString);

```

Then you need to bind that function to the UEngine’s OnNetworkFailure delegate:

```
GetEngine()->OnNetworkFailure().AddUObject(this, &UCTBallGameInstance::HandleNetworkFailure);

```

It gave me errors if i tried to bind it in the constructor so do it somewhere after that.
