Skip to content

Commit f063ff9

Browse files
committed
1 parent 1fb3a59 commit f063ff9

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,9 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
431431

432432
private async turnOn(): Promise<void> {
433433
try {
434+
if (!this.userDataSyncWorkbenchService.authenticationProviders.length) {
435+
throw new Error(localize('no authentication providers', "No authentication providers available."));
436+
}
434437
if (!this.storageService.getBoolean('sync.donotAskPreviewConfirmation', StorageScope.GLOBAL, false)) {
435438
if (!await this.askForConfirmation()) {
436439
return;
@@ -478,7 +481,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
478481
return;
479482
}
480483
}
481-
this.notificationService.error(localize('turn on failed', "Error while starting Sync: {0}", toErrorMessage(e)));
484+
this.notificationService.error(localize('turn on failed', "Error while starting Settings Sync: {0}", toErrorMessage(e)));
482485
}
483486
}
484487

src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
246246
}
247247

248248
async turnOn(): Promise<void> {
249+
if (!this.authenticationProviders.length) {
250+
throw new Error(localize('no authentication providers', "Settings sync cannot be turned on because there are no authentication providers available."));
251+
}
249252
if (this.userDataAutoSyncService.isEnabled()) {
250253
return;
251254
}

0 commit comments

Comments
 (0)