Skip to content

Commit b3206ec

Browse files
authored
Going back to VS Code after a PR is merged and the branch is deleted shows an error toast (#6686)
Fixes #6681
1 parent 1b726dd commit b3206ec

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

src/github/activityBarViewProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ export class PullRequestViewProvider extends WebviewViewBase implements vscode.W
325325
});
326326
})
327327
.catch(e => {
328-
vscode.window.showErrorMessage(formatError(e));
328+
vscode.window.showErrorMessage(`Error updating active pull request view: ${formatError(e)}`);
329329
});
330330
}
331331

src/github/githubRepository.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,8 @@ export class GitHubRepository extends Disposable {
263263
try {
264264
rsp = await gql.query<T>(query);
265265
} catch (e) {
266-
Logger.error(`Error querying GraphQL API: ${e.message}${e.graphQLErrors ? `. ${(e.graphQLErrors as GraphQLError[]).map(error => error.extensions?.code).join(',')}` : ''}`, this.id);
266+
const logInfo = (query.query.definitions[0] as { name: { value: string } | undefined }).name?.value;
267+
Logger.error(`Error querying GraphQL API (${logInfo}): ${e.message}${e.graphQLErrors ? `. ${(e.graphQLErrors as GraphQLError[]).map(error => error.extensions?.code).join(',')}` : ''}`, this.id);
267268
if (legacyFallback) {
268269
query.query = legacyFallback.query;
269270
return this.query(query, ignoreSamlErrors);

src/github/issueOverview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export class IssueOverviewPanel<TItem extends IssueModel = IssueModel> extends W
175175
});
176176
})
177177
.catch(e => {
178-
vscode.window.showErrorMessage(formatError(e));
178+
vscode.window.showErrorMessage(`Error updating issue description: ${formatError(e)}`);
179179
});
180180
}
181181

src/github/pullRequestOverview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ export class PullRequestOverviewPanel extends IssueOverviewPanel<PullRequestMode
327327
}
328328
})
329329
.catch(e => {
330-
vscode.window.showErrorMessage(formatError(e));
330+
vscode.window.showErrorMessage(`Error updating pull request description: ${formatError(e)}`);
331331
});
332332
}
333333

src/view/reviewManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ export class ReviewManager extends Disposable {
11051105
// The pull request was checked out, but the upstream branch was deleted
11061106
vscode.window.showInformationMessage('The remote branch for this pull request has been deleted. The file contents may not match the remote.');
11071107
} else {
1108-
vscode.window.showErrorMessage(formatError(e));
1108+
vscode.window.showErrorMessage(`Error switching to pull request: ${formatError(e)}`);
11091109
}
11101110
// todo, we should try to recover, for example, git checkout succeeds but set config fails.
11111111
if (this._folderRepoManager.activePullRequest?.number === pr.number) {

0 commit comments

Comments
 (0)