提交 83458e5b 编写于 作者: B Benjamin Pasero

text files - logging 💄

上级 8f51937a
...@@ -281,15 +281,19 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil ...@@ -281,15 +281,19 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
if (isNewModel) { if (isNewModel) {
const backup = await this.backupFileService.resolve<IBackupMetaData>(this.resource); const backup = await this.backupFileService.resolve<IBackupMetaData>(this.resource);
if (this.isResolved()) { // Return early if someone else managed to resolve the model by now
return this; // Make sure meanwhile someone else did not succeed in loading const isNewModel = !this.isResolved();
if (!isNewModel) {
this.logService.trace('[text file model] load() - exit - without loading because previously new model got created meanwhile', this.resource.toString(true));
return this;
} }
if (backup) { if (backup) {
try { try {
return await this.loadFromBackup(backup, options); return await this.loadFromBackup(backup, options);
} catch (error) { } catch (error) {
this.logService.error('[text file model] load() from backup', error); // ignore error and continue to load as file below this.logService.error('[text file model] load() from backup', error, this.resource.toString(true)); // ignore error and continue to load as file below
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册