Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions l10n/bundle.l10n.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@
"Connecting to the cluster using Entra ID…": "Connecting to the cluster using Entra ID…",
"connection \"{0}\"": "connection \"{0}\"",
"Connection String": "Connection String",
"Connection string cannot be empty.": "Connection string cannot be empty.",
"Connection string is not set": "Connection string is not set",
"Connection updated successfully.": "Connection updated successfully.",
"Connection: \"{selectedConnectionName}\"\n\nThe connection will be added to the \"Connections View\" in the \"DocumentDB for VS Code\" extension. The \"Connections View\" will be opened once this process completes.\n\nDo you want to continue?": "Connection: \"{selectedConnectionName}\"\n\nThe connection will be added to the \"Connections View\" in the \"DocumentDB for VS Code\" extension. The \"Connections View\" will be opened once this process completes.\n\nDo you want to continue?",
Expand Down
8 changes: 8 additions & 0 deletions src/commands/newConnection/PromptConnectionStringStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ export class PromptConnectionStringStep extends AzureWizardPromptStep<NewConnect

//eslint-disable-next-line @typescript-eslint/require-await
private async validateConnectionString(connectionString: string): Promise<string | null | undefined> {
connectionString = connectionString ? connectionString.trim() : '';

if (connectionString.length === 0) {
return l10n.t('Invalid Connection String: {error}', {
error: l10n.t('Connection string cannot be empty.'),
});
}

try {
new DocumentDBConnectionString(connectionString);
} catch (error) {
Expand Down