mirror of
https://github.com/denoland/deno.git
synced 2025-07-23 13:15:16 +00:00
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:
parent
423b02d889
commit
668b400ff2
17 changed files with 589 additions and 135 deletions
|
@ -59,15 +59,23 @@ unitTest(
|
|||
);
|
||||
|
||||
unitTest({ permissions: { write: true } }, function mkdirErrSyncIfExists() {
|
||||
assertThrows(() => {
|
||||
Deno.mkdirSync(".");
|
||||
}, Deno.errors.AlreadyExists);
|
||||
assertThrows(
|
||||
() => {
|
||||
Deno.mkdirSync(".");
|
||||
},
|
||||
Deno.errors.AlreadyExists,
|
||||
`mkdir '.'`,
|
||||
);
|
||||
});
|
||||
|
||||
unitTest({ permissions: { write: true } }, async function mkdirErrIfExists() {
|
||||
await assertRejects(async () => {
|
||||
await Deno.mkdir(".");
|
||||
}, Deno.errors.AlreadyExists);
|
||||
await assertRejects(
|
||||
async () => {
|
||||
await Deno.mkdir(".");
|
||||
},
|
||||
Deno.errors.AlreadyExists,
|
||||
`mkdir '.'`,
|
||||
);
|
||||
});
|
||||
|
||||
unitTest(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue