better error message when trying to open huge files #43861

This commit is contained in:
Johannes Rieken
2018-02-28 14:38:01 +01:00
parent a084190343
commit bca16d831e

View File

@@ -193,8 +193,11 @@ export class MainThreadDocuments implements MainThreadDocumentsShape {
return promise.then(success => {
if (!success) {
return TPromise.wrapError(new Error('cannot open ' + uri.toString()));
} else if (!this._modelIsSynced[uri.toString()]) {
return TPromise.wrapError(new Error('cannot open ' + uri.toString() + '. Detail: Files above 50MB cannot be synchronized with extensions.'));
} else {
return undefined;
}
return undefined;
}, err => {
return TPromise.wrapError(new Error('cannot open ' + uri.toString() + '. Detail: ' + toErrorMessage(err)));
});