mirror of
https://github.com/denoland/deno.git
synced 2025-09-28 05:04:48 +00:00
refactor: remove unneeded ErrorKinds (#3936)
This commit is contained in:
parent
d9efb8c02a
commit
dd8a109481
66 changed files with 553 additions and 620 deletions
|
@ -23,8 +23,7 @@ testPerm({ read: false }, async function statSyncPerm(): Promise<void> {
|
|||
Deno.statSync("README.md");
|
||||
} catch (e) {
|
||||
caughtError = true;
|
||||
assertEquals(e.kind, Deno.ErrorKind.PermissionDenied);
|
||||
assertEquals(e.name, "PermissionDenied");
|
||||
assert(e instanceof Deno.Err.PermissionDenied);
|
||||
}
|
||||
assert(caughtError);
|
||||
});
|
||||
|
@ -37,8 +36,7 @@ testPerm({ read: true }, async function statSyncNotFound(): Promise<void> {
|
|||
badInfo = Deno.statSync("bad_file_name");
|
||||
} catch (err) {
|
||||
caughtError = true;
|
||||
assertEquals(err.kind, Deno.ErrorKind.NotFound);
|
||||
assertEquals(err.name, "NotFound");
|
||||
assert(err instanceof Deno.Err.NotFound);
|
||||
}
|
||||
|
||||
assert(caughtError);
|
||||
|
@ -65,8 +63,7 @@ testPerm({ read: false }, async function lstatSyncPerm(): Promise<void> {
|
|||
Deno.lstatSync("README.md");
|
||||
} catch (e) {
|
||||
caughtError = true;
|
||||
assertEquals(e.kind, Deno.ErrorKind.PermissionDenied);
|
||||
assertEquals(e.name, "PermissionDenied");
|
||||
assert(e instanceof Deno.Err.PermissionDenied);
|
||||
}
|
||||
assert(caughtError);
|
||||
});
|
||||
|
@ -79,8 +76,7 @@ testPerm({ read: true }, async function lstatSyncNotFound(): Promise<void> {
|
|||
badInfo = Deno.lstatSync("bad_file_name");
|
||||
} catch (err) {
|
||||
caughtError = true;
|
||||
assertEquals(err.kind, Deno.ErrorKind.NotFound);
|
||||
assertEquals(err.name, "NotFound");
|
||||
assert(err instanceof Deno.Err.NotFound);
|
||||
}
|
||||
|
||||
assert(caughtError);
|
||||
|
@ -107,8 +103,7 @@ testPerm({ read: false }, async function statPerm(): Promise<void> {
|
|||
await Deno.stat("README.md");
|
||||
} catch (e) {
|
||||
caughtError = true;
|
||||
assertEquals(e.kind, Deno.ErrorKind.PermissionDenied);
|
||||
assertEquals(e.name, "PermissionDenied");
|
||||
assert(e instanceof Deno.Err.PermissionDenied);
|
||||
}
|
||||
assert(caughtError);
|
||||
});
|
||||
|
@ -121,8 +116,7 @@ testPerm({ read: true }, async function statNotFound(): Promise<void> {
|
|||
badInfo = await Deno.stat("bad_file_name");
|
||||
} catch (err) {
|
||||
caughtError = true;
|
||||
assertEquals(err.kind, Deno.ErrorKind.NotFound);
|
||||
assertEquals(err.name, "NotFound");
|
||||
assert(err instanceof Deno.Err.NotFound);
|
||||
}
|
||||
|
||||
assert(caughtError);
|
||||
|
@ -149,8 +143,7 @@ testPerm({ read: false }, async function lstatPerm(): Promise<void> {
|
|||
await Deno.lstat("README.md");
|
||||
} catch (e) {
|
||||
caughtError = true;
|
||||
assertEquals(e.kind, Deno.ErrorKind.PermissionDenied);
|
||||
assertEquals(e.name, "PermissionDenied");
|
||||
assert(e instanceof Deno.Err.PermissionDenied);
|
||||
}
|
||||
assert(caughtError);
|
||||
});
|
||||
|
@ -163,8 +156,7 @@ testPerm({ read: true }, async function lstatNotFound(): Promise<void> {
|
|||
badInfo = await Deno.lstat("bad_file_name");
|
||||
} catch (err) {
|
||||
caughtError = true;
|
||||
assertEquals(err.kind, Deno.ErrorKind.NotFound);
|
||||
assertEquals(err.name, "NotFound");
|
||||
assert(err instanceof Deno.Err.NotFound);
|
||||
}
|
||||
|
||||
assert(caughtError);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue