Skip to content

Commit

Permalink
Merge pull request #1430 from SteamRE/connect-throw
Browse files Browse the repository at this point in the history
  • Loading branch information
yaakov-h authored Sep 14, 2024
2 parents 35f32bc + d7293bd commit 08e2df9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion SteamKit2/SteamKit2/Steam/CMClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,16 @@ void Connected( object? sender, EventArgs e )
Servers.TryMark( connection.CurrentEndPoint, connection.ProtocolTypes, ServerQuality.Good );

IsConnected = true;
OnClientConnected();

try
{
OnClientConnected();
}
catch ( Exception ex )
{
DebugLog.WriteLine( nameof(CMClient), "Unhandled exception after connecting: {0}", ex );
Disconnect(userInitiated: false);
}
}

void Disconnected( object? sender, DisconnectedEventArgs e )
Expand Down

0 comments on commit 08e2df9

Please sign in to comment.