Skip to content

Commit 0dce868

Browse files
authored
Prepare for syncing profiles (microsoft#160455)
- First step of making UserDataSyncService profiles aware
1 parent b25f6bf commit 0dce868

File tree

3 files changed

+220
-153
lines changed

3 files changed

+220
-153
lines changed

src/vs/platform/userDataSync/common/abstractSynchronizer.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,15 @@ export abstract class AbstractSynchroniser extends Disposable implements IUserDa
676676
protected async updateRemoteUserData(content: string, ref: string | null): Promise<IRemoteUserData> {
677677
const machineId = await this.currentMachineIdPromise;
678678
const syncData: ISyncData = { version: this.version, machineId, content };
679-
ref = await this.userDataSyncStoreService.write(this.resource, JSON.stringify(syncData), ref, undefined, this.syncHeaders);
680-
return { ref, syncData };
679+
try {
680+
ref = await this.userDataSyncStoreService.write(this.resource, JSON.stringify(syncData), ref, undefined, this.syncHeaders);
681+
return { ref, syncData };
682+
} catch (error) {
683+
if (error instanceof UserDataSyncError && error.code === UserDataSyncErrorCode.TooLarge) {
684+
error = new UserDataSyncError(error.message, error.code, this.resource);
685+
}
686+
throw error;
687+
}
681688
}
682689

683690
protected async backupLocal(content: string): Promise<void> {

0 commit comments

Comments
 (0)