Prevent crashes on resume due to connectivity issues.

This commit is contained in:
Burak Kaan Köse
2024-09-14 01:33:35 +02:00
parent 9a44e30e0f
commit 13c8bf5f19

View File

@@ -187,7 +187,18 @@ namespace Wino
// We must restore it.
// Server might be running already, but re-launching it will trigger a new connection attempt.
await _appServiceConnectionManager.ConnectAsync();
try
{
await _appServiceConnectionManager.ConnectAsync();
}
catch (OperationCanceledException)
{
// Ignore
}
catch (Exception ex)
{
Log.Error(ex, "Failed to connect to server after resuming the app.");
}
}
private void OnSuspending(object sender, SuspendingEventArgs e)