Skip to content

Commit 9868091

Browse files
committed
fix: try/catch for fetching the session token
1 parent 8086c7b commit 9868091

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/storage.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@ export class Storage {
5252
}
5353

5454
public async getSessionToken(): Promise<string | undefined> {
55-
return this.secrets.get("sessionToken")
55+
try {
56+
return await this.secrets.get("sessionToken")
57+
} catch (ex) {
58+
// The VS Code session store has become corrupt before, and
59+
// will fail to get the session token...
60+
return undefined
61+
}
5662
}
5763

5864
// getRemoteSSHLogPath returns the log path for the "Remote - SSH" output panel.

0 commit comments

Comments
 (0)