Skip to content

Commit e0cdfc3

Browse files
Copilotalexr00
andcommitted
Add logging for getCurrentUser errors in workspace context
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent b9f7cb0 commit e0cdfc3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lm/pullRequestContextProvider.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import * as vscode from 'vscode';
77
import { GitApiImpl } from '../api/api1';
88
import { Disposable } from '../common/lifecycle';
9+
import Logger from '../common/logger';
910
import { onceEvent } from '../common/utils';
1011
import { PullRequestModel } from '../github/pullRequestModel';
1112
import { PullRequestOverviewPanel } from '../github/pullRequestOverview';
@@ -17,6 +18,7 @@ interface PRChatContextItem extends vscode.ChatContextItem {
1718
}
1819

1920
export class PullRequestContextProvider extends Disposable implements vscode.ChatContextProvider {
21+
private static readonly ID = 'PullRequestContextProvider';
2022
private readonly _onDidChangeWorkspaceChatContext = new vscode.EventEmitter<void>();
2123
readonly onDidChangeWorkspaceChatContext = this._onDidChangeWorkspaceChatContext.event;
2224

@@ -79,6 +81,7 @@ Current user: ${currentUser.login}`;
7981
}
8082
} catch (e) {
8183
// If we can't get the current user, continue without it
84+
Logger.debug(`Failed to get current user for workspace context: ${e}`, PullRequestContextProvider.ID);
8285
}
8386

8487
if (folderManager.activePullRequest) {

0 commit comments

Comments
 (0)