wrap error into FileSystemError, #48034

This commit is contained in:
Johannes Rieken
2019-07-09 15:19:53 +02:00
parent 1566f05f10
commit 51123cd133
2 changed files with 40 additions and 9 deletions

View File

@@ -116,4 +116,27 @@ suite('workspace-fs', () => {
assert.ok(true);
}
});
test('throws FileSystemError', async function () {
try {
await vscode.workspace.fs.stat(vscode.Uri.file(`/c468bf16-acfd-4591-825e-2bcebba508a3/71b1f274-91cb-4c19-af00-8495eaab4b73/4b60cb48-a6f2-40ea-9085-0936f4a8f59a.tx6`));
assert.ok(false);
} catch (e) {
assert.ok(e instanceof vscode.FileSystemError);
assert.ok(e.message);
}
});
test('throws FileSystemError', async function () {
try {
await vscode.workspace.fs.stat(vscode.Uri.parse('foo:/bar'));
assert.ok(false);
} catch (e) {
assert.ok(e instanceof vscode.FileSystemError);
assert.ok(e.message);
assert.ok(e.name);
}
});
});