mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-14 11:03:01 -04:00
Merge from vscode 5b9869eb02fa4c96205a74d05cad9164dfd06d60 (#5607)
This commit is contained in:
@@ -26,21 +26,23 @@ export class FileStorage {
|
||||
return this._database;
|
||||
}
|
||||
|
||||
init(): Promise<void> {
|
||||
return readFile(this.dbPath).then(contents => {
|
||||
async init(): Promise<void> {
|
||||
try {
|
||||
const contents = await readFile(this.dbPath);
|
||||
|
||||
try {
|
||||
this.lastFlushedSerializedDatabase = contents.toString();
|
||||
this._database = JSON.parse(this.lastFlushedSerializedDatabase);
|
||||
} catch (error) {
|
||||
this._database = {};
|
||||
}
|
||||
}, error => {
|
||||
} catch (error) {
|
||||
if (error.code !== 'ENOENT') {
|
||||
this.onError(error);
|
||||
}
|
||||
|
||||
this._database = {};
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private loadSync(): object {
|
||||
|
||||
Reference in New Issue
Block a user