feat(runtime): improve error messages of runtime fs (#11984)

This commit annotates errors returned from FS Deno APIs to include
paths that were passed to the API calls.

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This commit is contained in:
Feng Yu 2021-10-11 21:21:18 +08:00 committed by GitHub
parent 423b02d889
commit 668b400ff2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 589 additions and 135 deletions

View file

@ -52,8 +52,12 @@ unitTest(
{ permissions: { read: true, write: true } },
function dirChdirError() {
const path = Deno.makeTempDirSync() + "test";
assertThrows(() => {
Deno.chdir(path);
}, Deno.errors.NotFound);
assertThrows(
() => {
Deno.chdir(path);
},
Deno.errors.NotFound,
`chdir '${path}'`,
);
},
);