Skip to content

Commit 81a22b7

Browse files
author
Keegan Irby
committed
Catch exceptions while calling StartLiveTail
1 parent 4cd56b5 commit 81a22b7

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

packages/core/src/awsService/cloudWatchLogs/registry/liveTailSession.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as vscode from 'vscode'
66
import { CloudWatchLogsClient, StartLiveTailCommand, StartLiveTailCommandOutput } from '@aws-sdk/client-cloudwatch-logs'
77
import { LogStreamFilterResponse } from '../liveTailLogStreamSubmenu'
88
import { CloudWatchLogsSettings } from '../cloudWatchLogsUtils'
9-
import { Settings } from '../../../shared'
9+
import { Settings, ToolkitError } from '../../../shared'
1010
import { createLiveTailURIFromArgs } from './liveTailSessionRegistry'
1111

1212
export type LiveTailSessionConfiguration = {
@@ -56,9 +56,13 @@ export class LiveTailSession {
5656

5757
public startLiveTailSession(): Promise<StartLiveTailCommandOutput> {
5858
const command = this.buildStartLiveTailCommand()
59-
return this.liveTailClient.cwlClient.send(command, {
60-
abortSignal: this.liveTailClient.abortController.signal,
61-
})
59+
try {
60+
return this.liveTailClient.cwlClient.send(command, {
61+
abortSignal: this.liveTailClient.abortController.signal,
62+
})
63+
} catch (e) {
64+
throw new ToolkitError('Encountered error while trying to start LiveTail session.')
65+
}
6266
}
6367

6468
public stopLiveTailSession() {

0 commit comments

Comments
 (0)