Skip to content

Commit 0cad12f

Browse files
committed
code review comments
1 parent 0b2f5f9 commit 0cad12f

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

App/App.xaml.cs

+9-10
Original file line numberDiff line numberDiff line change
@@ -115,24 +115,24 @@ protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs ar
115115
if (rpcController.GetState().RpcLifecycle == RpcLifecycle.Disconnected)
116116
// Passing in a CT with no cancellation is desired here, because
117117
// the named pipe open will block until the pipe comes up.
118-
// TODO: log
119-
_ = rpcController.Reconnect(CancellationToken.None).ContinueWith(t =>
118+
_logger.LogDebug("reconnecting with VPN service");
119+
_ = rpcController.Reconnect(CancellationToken.None).ContinueWith(t =>
120+
{
121+
if (t.Exception != null)
120122
{
123+
_logger.LogError(t.Exception, "failed to connect to VPN service");
121124
#if DEBUG
122-
if (t.Exception != null)
123-
{
124-
Debug.WriteLine(t.Exception);
125-
Debugger.Break();
126-
}
125+
Debug.WriteLine(t.Exception);
126+
Debugger.Break();
127127
#endif
128-
});
128+
}
129+
});
129130

130131
// Load the credentials in the background.
131132
var credentialManagerCts = new CancellationTokenSource(TimeSpan.FromSeconds(15));
132133
var credentialManager = _services.GetRequiredService<ICredentialManager>();
133134
_ = credentialManager.LoadCredentials(credentialManagerCts.Token).ContinueWith(t =>
134135
{
135-
// TODO: log
136136
if (t.Exception != null)
137137
{
138138
_logger.LogError(t.Exception, "failed to load credentials");
@@ -150,7 +150,6 @@ protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs ar
150150
var syncSessionController = _services.GetRequiredService<ISyncSessionController>();
151151
_ = syncSessionController.RefreshState(syncSessionCts.Token).ContinueWith(t =>
152152
{
153-
// TODO: log
154153
if (t.IsCanceled || t.Exception != null)
155154
{
156155
_logger.LogError(t.Exception, "failed to refresh sync state (canceled = {canceled})", t.IsCanceled);

0 commit comments

Comments
 (0)