Skip to content

Commit

Permalink
Change warning to error
Browse files Browse the repository at this point in the history
Signed-off-by: David Kwon <[email protected]>
  • Loading branch information
dkwon17 committed Oct 24, 2024
1 parent 115b5b4 commit d415992
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ export class ActivityTrackerService {
// Flag which is used to check if new requests were received during timer awaiting.
private isNewRequest: boolean;
// Flag used to keep track whether the ping error warning was already displayed or not.
private warningDisplayed: boolean;
private errorDisplayed: boolean;
private workspaceService: WorkspaceService;
private channel: vscode.OutputChannel;

constructor(workspaceService: WorkspaceService, channel: vscode.OutputChannel) {
this.isTimerRunning = false;
this.isNewRequest = false;
this.warningDisplayed = false;
this.errorDisplayed = false;
this.workspaceService = workspaceService;
this.channel = channel;
}
Expand Down Expand Up @@ -83,18 +83,18 @@ export class ActivityTrackerService {
await this.sendRequest(--attemptsLeft);
} else {
this.channel.appendLine('Activity tracker: Failed to ping che-machine-exec: ' + error.message);
if (!this.warningDisplayed) {
this.warningDisplayed = true;
this.showWarningMessage();
if (!this.errorDisplayed) {
this.errorDisplayed = true;
this.showErrorMessage();
}
}
}
}

private async showWarningMessage(): Promise<void> {
private async showErrorMessage(): Promise<void> {
const viewText = 'View Logs';
const response = await vscode.window.showWarningMessage(
this.getWarningMessage(),
const response = await vscode.window.showErrorMessage(
this.getErrorMessage(),
viewText
);

Expand All @@ -103,7 +103,7 @@ export class ActivityTrackerService {
}
}

private getWarningMessage(): string {
private getErrorMessage(): string {

let message = 'Failed to communicate with idling service.';

Expand Down

0 comments on commit d415992

Please sign in to comment.