Skip to content

Commit fe07b33

Browse files
committed
more review suggestions, fmt
1 parent 8c5a07f commit fe07b33

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

App/App.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,12 @@ public void OnActivated(object? sender, AppActivationArguments args)
195195
return;
196196
}
197197

198-
// don't need to wait for it to complete.
198+
// don't need to wait for it to complete.
199199
_uriHandler.HandleUri(protoArgs.Uri).ContinueWith(t =>
200200
{
201201
if (t.Exception != null)
202202
{
203+
// don't log query params, as they contain secrets.
203204
_logger.LogError(t.Exception,
204205
"unhandled exception while processing URI coder://{authority}{path}",
205206
protoArgs.Uri.Authority, protoArgs.Uri.AbsolutePath);

App/Services/UriHandler.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,18 @@ public async Task HandleOpenWorkspaceApp(Uri uri, CancellationToken ct = default
8585
}
8686

8787
var workspace = state.Workspaces.FirstOrDefault(w => w.Name == workspaceName);
88-
if (workspace == null) {
88+
if (workspace == null)
89+
{
8990
logger.LogDebug("got URI to open workspace '{workspace}', but the workspace doesn't exist", workspaceName);
9091
throw new UriException(errTitle,
9192
$"Failed to open application on workspace '{workspaceName}' because it doesn't exist");
9293
}
9394

9495
var agent = state.Agents.FirstOrDefault(a => a.WorkspaceId == workspace.Id && a.Name == agentName);
95-
if (agent == null) {
96-
logger.LogDebug("got URI to open workspace/agent '{workspaceName}/{agentName}', but the agent doesn't exist",
96+
if (agent == null)
97+
{
98+
logger.LogDebug(
99+
"got URI to open workspace/agent '{workspaceName}/{agentName}', but the agent doesn't exist",
97100
workspaceName, agentName);
98101
// If the workspace isn't running, that is almost certainly why we can't find the agent, so report that
99102
// to the user.
@@ -102,6 +105,7 @@ public async Task HandleOpenWorkspaceApp(Uri uri, CancellationToken ct = default
102105
throw new UriException(errTitle,
103106
$"Failed to open application on workspace '{workspaceName}', because the workspace is not running.");
104107
}
108+
105109
throw new UriException(errTitle,
106110
$"Failed to open application on workspace '{workspaceName}', because agent '{agentName}' doesn't exist.");
107111
}

0 commit comments

Comments
 (0)