summaryrefslogtreecommitdiff
path: root/cli/js
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js')
-rw-r--r--cli/js/chmod_test.ts8
-rw-r--r--cli/js/chown_test.ts10
-rw-r--r--cli/js/copy_file_test.ts12
-rw-r--r--cli/js/deno.ts2
-rw-r--r--cli/js/dir_test.ts4
-rw-r--r--cli/js/dispatch_minimal.ts4
-rw-r--r--cli/js/errors.ts4
-rw-r--r--cli/js/fetch_test.ts4
-rw-r--r--cli/js/files_test.ts6
-rw-r--r--cli/js/fs_events_test.ts2
-rw-r--r--cli/js/lib.deno.ns.d.ts2
-rw-r--r--cli/js/link_test.ts8
-rw-r--r--cli/js/make_temp_test.ts12
-rw-r--r--cli/js/mkdir_test.ts4
-rw-r--r--cli/js/net_test.ts6
-rw-r--r--cli/js/os.ts4
-rw-r--r--cli/js/os_test.ts12
-rw-r--r--cli/js/process_test.ts6
-rw-r--r--cli/js/read_dir_test.ts6
-rw-r--r--cli/js/read_file_test.ts6
-rw-r--r--cli/js/read_link_test.ts6
-rw-r--r--cli/js/realpath_test.ts8
-rw-r--r--cli/js/remove_test.ts44
-rw-r--r--cli/js/rename_test.ts8
-rw-r--r--cli/js/stat_test.ts16
-rw-r--r--cli/js/streams/pipe-to.ts2
-rw-r--r--cli/js/symlink_test.ts2
-rw-r--r--cli/js/tls_test.ts10
-rw-r--r--cli/js/truncate_test.ts4
-rw-r--r--cli/js/utime_test.ts8
-rw-r--r--cli/js/write_file_test.ts12
31 files changed, 121 insertions, 121 deletions
diff --git a/cli/js/chmod_test.ts b/cli/js/chmod_test.ts
index 24c69db7a..d6ff64316 100644
--- a/cli/js/chmod_test.ts
+++ b/cli/js/chmod_test.ts
@@ -60,7 +60,7 @@ testPerm({ write: true }, function chmodSyncFailure(): void {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
});
testPerm({ write: false }, function chmodSyncPerm(): void {
@@ -70,7 +70,7 @@ testPerm({ write: false }, function chmodSyncPerm(): void {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
@@ -133,7 +133,7 @@ testPerm({ write: true }, async function chmodFailure(): Promise<void> {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
});
testPerm({ write: false }, async function chmodPerm(): Promise<void> {
@@ -143,6 +143,6 @@ testPerm({ write: false }, async function chmodPerm(): Promise<void> {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
diff --git a/cli/js/chown_test.ts b/cli/js/chown_test.ts
index a1c12860d..61c6b8736 100644
--- a/cli/js/chown_test.ts
+++ b/cli/js/chown_test.ts
@@ -31,7 +31,7 @@ if (Deno.build.os !== "win") {
try {
await Deno.chown(filePath, 1000, 1000);
} catch (e) {
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
});
@@ -44,7 +44,7 @@ if (Deno.build.os !== "win") {
try {
Deno.chownSync(filePath, uid, gid);
} catch (e) {
- assert(e instanceof Deno.Err.NotFound);
+ assert(e instanceof Deno.errors.NotFound);
}
}
);
@@ -58,7 +58,7 @@ if (Deno.build.os !== "win") {
try {
await Deno.chown(filePath, uid, gid);
} catch (e) {
- assert(e instanceof Deno.Err.NotFound);
+ assert(e instanceof Deno.errors.NotFound);
}
}
);
@@ -74,7 +74,7 @@ if (Deno.build.os !== "win") {
// try changing the file's owner to root
Deno.chownSync(filePath, 0, 0);
} catch (e) {
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
Deno.removeSync(dirPath, { recursive: true });
});
@@ -92,7 +92,7 @@ if (Deno.build.os !== "win") {
// try changing the file's owner to root
await Deno.chown(filePath, 0, 0);
} catch (e) {
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
await Deno.remove(dirPath, { recursive: true });
});
diff --git a/cli/js/copy_file_test.ts b/cli/js/copy_file_test.ts
index 567b246b7..aa6daeebf 100644
--- a/cli/js/copy_file_test.ts
+++ b/cli/js/copy_file_test.ts
@@ -43,7 +43,7 @@ testPerm({ write: true, read: true }, function copyFileSyncFailure(): void {
err = e;
}
assert(!!err);
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
});
testPerm({ write: true, read: false }, function copyFileSyncPerm1(): void {
@@ -52,7 +52,7 @@ testPerm({ write: true, read: false }, function copyFileSyncPerm1(): void {
Deno.copyFileSync("/from.txt", "/to.txt");
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
@@ -63,7 +63,7 @@ testPerm({ write: false, read: true }, function copyFileSyncPerm2(): void {
Deno.copyFileSync("/from.txt", "/to.txt");
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
@@ -110,7 +110,7 @@ testPerm({ read: true, write: true }, async function copyFileFailure(): Promise<
err = e;
}
assert(!!err);
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
});
testPerm(
@@ -138,7 +138,7 @@ testPerm({ read: false, write: true }, async function copyFilePerm1(): Promise<
await Deno.copyFile("/from.txt", "/to.txt");
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
@@ -151,7 +151,7 @@ testPerm({ read: true, write: false }, async function copyFilePerm2(): Promise<
await Deno.copyFile("/from.txt", "/to.txt");
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
diff --git a/cli/js/deno.ts b/cli/js/deno.ts
index f5f774179..e2052f729 100644
--- a/cli/js/deno.ts
+++ b/cli/js/deno.ts
@@ -22,7 +22,7 @@ export {
} from "./diagnostics.ts";
export { chdir, cwd } from "./dir.ts";
export { applySourceMap } from "./error_stack.ts";
-export { Err } from "./errors.ts";
+export { errors } from "./errors.ts";
export { FileInfo } from "./file_info.ts";
export {
File,
diff --git a/cli/js/dir_test.ts b/cli/js/dir_test.ts
index f936986aa..6444f35a3 100644
--- a/cli/js/dir_test.ts
+++ b/cli/js/dir_test.ts
@@ -29,7 +29,7 @@ testPerm({ write: true }, function dirCwdError(): void {
Deno.cwd();
throw Error("current directory removed, should throw error");
} catch (err) {
- if (err instanceof Deno.Err.NotFound) {
+ if (err instanceof Deno.errors.NotFound) {
console.log(err.name === "NotFound");
} else {
throw Error("raised different exception");
@@ -45,7 +45,7 @@ testPerm({ write: true }, function dirChdirError(): void {
Deno.chdir(path);
throw Error("directory not available, should throw error");
} catch (err) {
- if (err instanceof Deno.Err.NotFound) {
+ if (err instanceof Deno.errors.NotFound) {
console.log(err.name === "NotFound");
} else {
throw Error("raised different exception");
diff --git a/cli/js/dispatch_minimal.ts b/cli/js/dispatch_minimal.ts
index 203701085..988cb8af2 100644
--- a/cli/js/dispatch_minimal.ts
+++ b/cli/js/dispatch_minimal.ts
@@ -2,7 +2,7 @@
import * as util from "./util.ts";
import { core } from "./core.ts";
import { TextDecoder } from "./text_encoding.ts";
-import { Err, ErrorKind, constructError } from "./errors.ts";
+import { errors, ErrorKind, constructError } from "./errors.ts";
const promiseTableMin = new Map<number, util.Resolvable<RecordMinimal>>();
// Note it's important that promiseId starts at 1 instead of 0, because sync
@@ -43,7 +43,7 @@ export function recordFromBufMinimal(ui8: Uint8Array): RecordMinimal {
const message = decoder.decode(ui8.slice(12));
err = { kind, message };
} else if (ui8.length != 12) {
- throw new Err.InvalidData("BadMessage");
+ throw new errors.InvalidData("BadMessage");
}
return {
diff --git a/cli/js/errors.ts b/cli/js/errors.ts
index 0844b0a56..0379f3c96 100644
--- a/cli/js/errors.ts
+++ b/cli/js/errors.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-// Warning! The values in this enum are duplicated in cli/msg.rs
+// Warning! The values in this enum are duplicated in cli/op_error.rs
// Update carefully!
export enum ErrorKind {
NotFound = 1,
@@ -179,7 +179,7 @@ class Http extends Error {
}
}
-export const Err = {
+export const errors = {
NotFound: NotFound,
PermissionDenied: PermissionDenied,
ConnectionRefused: ConnectionRefused,
diff --git a/cli/js/fetch_test.ts b/cli/js/fetch_test.ts
index 54bec46be..a51d1cd4a 100644
--- a/cli/js/fetch_test.ts
+++ b/cli/js/fetch_test.ts
@@ -27,7 +27,7 @@ testPerm({ net: true }, async function fetchConnectionError(): Promise<void> {
} catch (err_) {
err = err_;
}
- assert(err instanceof Deno.Err.Http);
+ assert(err instanceof Deno.errors.Http);
assertStrContains(err.message, "error trying to connect");
});
@@ -44,7 +44,7 @@ test(async function fetchPerm(): Promise<void> {
} catch (err_) {
err = err_;
}
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
diff --git a/cli/js/files_test.ts b/cli/js/files_test.ts
index f71bfecc0..de0d3019a 100644
--- a/cli/js/files_test.ts
+++ b/cli/js/files_test.ts
@@ -79,7 +79,7 @@ testPerm({ write: false }, async function writePermFailure(): Promise<void> {
err = e;
}
assert(!!err);
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
}
});
@@ -136,7 +136,7 @@ testPerm({ read: false }, async function readPermFailure(): Promise<void> {
await Deno.open("cli/tests/fixture.json", "r");
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
@@ -208,7 +208,7 @@ testPerm(
err = e;
}
assert(!!err);
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
}
}
diff --git a/cli/js/fs_events_test.ts b/cli/js/fs_events_test.ts
index 161ee2ebf..86a5c2813 100644
--- a/cli/js/fs_events_test.ts
+++ b/cli/js/fs_events_test.ts
@@ -8,7 +8,7 @@ testPerm({ read: false }, function fsEventsPermissions() {
try {
Deno.fsEvents(".");
} catch (err) {
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
thrown = true;
}
assert(thrown);
diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts
index 4d7822c90..b22d89ebe 100644
--- a/cli/js/lib.deno.ns.d.ts
+++ b/cli/js/lib.deno.ns.d.ts
@@ -1217,7 +1217,7 @@ declare namespace Deno {
export function applySourceMap(location: Location): Location;
/* eslint-disable @typescript-eslint/no-unused-vars */
- namespace Err {
+ namespace errors {
class NotFound extends Error {
constructor(msg: string);
}
diff --git a/cli/js/link_test.ts b/cli/js/link_test.ts
index 229207137..b6ba46f2d 100644
--- a/cli/js/link_test.ts
+++ b/cli/js/link_test.ts
@@ -43,7 +43,7 @@ testPerm({ read: true, write: true }, function linkSyncExists(): void {
err = e;
}
assert(!!err);
- assert(err instanceof Deno.Err.AlreadyExists);
+ assert(err instanceof Deno.errors.AlreadyExists);
});
testPerm({ read: true, write: true }, function linkSyncNotFound(): void {
@@ -58,7 +58,7 @@ testPerm({ read: true, write: true }, function linkSyncNotFound(): void {
err = e;
}
assert(!!err);
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
});
testPerm({ read: false, write: true }, function linkSyncReadPerm(): void {
@@ -68,7 +68,7 @@ testPerm({ read: false, write: true }, function linkSyncReadPerm(): void {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
@@ -79,7 +79,7 @@ testPerm({ read: true, write: false }, function linkSyncWritePerm(): void {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
diff --git a/cli/js/make_temp_test.ts b/cli/js/make_temp_test.ts
index 06bfe0373..83a174e83 100644
--- a/cli/js/make_temp_test.ts
+++ b/cli/js/make_temp_test.ts
@@ -23,7 +23,7 @@ testPerm({ write: true }, function makeTempDirSyncSuccess(): void {
} catch (err_) {
err = err_;
}
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
});
test(function makeTempDirSyncPerm(): void {
@@ -34,7 +34,7 @@ test(function makeTempDirSyncPerm(): void {
} catch (err_) {
err = err_;
}
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
@@ -60,7 +60,7 @@ testPerm({ write: true }, async function makeTempDirSuccess(): Promise<void> {
} catch (err_) {
err = err_;
}
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
});
testPerm({ write: true }, function makeTempFileSyncSuccess(): void {
@@ -86,7 +86,7 @@ testPerm({ write: true }, function makeTempFileSyncSuccess(): void {
} catch (err_) {
err = err_;
}
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
});
test(function makeTempFileSyncPerm(): void {
@@ -97,7 +97,7 @@ test(function makeTempFileSyncPerm(): void {
} catch (err_) {
err = err_;
}
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
@@ -124,5 +124,5 @@ testPerm({ write: true }, async function makeTempFileSuccess(): Promise<void> {
} catch (err_) {
err = err_;
}
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
});
diff --git a/cli/js/mkdir_test.ts b/cli/js/mkdir_test.ts
index 856cbdeb5..655a23dc3 100644
--- a/cli/js/mkdir_test.ts
+++ b/cli/js/mkdir_test.ts
@@ -25,7 +25,7 @@ testPerm({ write: false }, function mkdirSyncPerm(): void {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
@@ -45,7 +45,7 @@ testPerm({ write: true }, function mkdirErrIfExists(): void {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.AlreadyExists);
+ assert(err instanceof Deno.errors.AlreadyExists);
});
testPerm({ read: true, write: true }, function mkdirSyncRecursive(): void {
diff --git a/cli/js/net_test.ts b/cli/js/net_test.ts
index 75bce2e52..94e7c976e 100644
--- a/cli/js/net_test.ts
+++ b/cli/js/net_test.ts
@@ -223,7 +223,7 @@ testPerm({ net: true }, async function netDoubleCloseRead() {
err = e;
}
assert(!!err);
- assert(err instanceof Deno.Err.NotConnected);
+ assert(err instanceof Deno.errors.NotConnected);
closeDeferred.resolve();
listener.close();
conn.close();
@@ -257,7 +257,7 @@ testPerm({ net: true }, async function netCloseWriteSuccess() {
err = e;
}
assert(!!err);
- assert(err instanceof Deno.Err.BrokenPipe);
+ assert(err instanceof Deno.errors.BrokenPipe);
closeDeferred.resolve();
listener.close();
conn.close();
@@ -283,7 +283,7 @@ testPerm({ net: true }, async function netDoubleCloseWrite() {
err = e;
}
assert(!!err);
- assert(err instanceof Deno.Err.NotConnected);
+ assert(err instanceof Deno.errors.NotConnected);
closeDeferred.resolve();
listener.close();
conn.close();
diff --git a/cli/js/os.ts b/cli/js/os.ts
index 7953c2cef..7458ee469 100644
--- a/cli/js/os.ts
+++ b/cli/js/os.ts
@@ -1,7 +1,7 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import * as dispatch from "./dispatch.ts";
import { sendSync } from "./dispatch_json.ts";
-import { Err } from "./errors.ts";
+import { errors } from "./errors.ts";
import * as util from "./util.ts";
/** Check if running in terminal.
@@ -210,7 +210,7 @@ export function dir(kind: DirKind): string | null {
try {
return sendSync(dispatch.OP_GET_DIR, { kind });
} catch (error) {
- if (error instanceof Err.PermissionDenied) {
+ if (error instanceof errors.PermissionDenied) {
throw error;
}
return null;
diff --git a/cli/js/os_test.ts b/cli/js/os_test.ts
index 905a4efaf..11d2db8fe 100644
--- a/cli/js/os_test.ts
+++ b/cli/js/os_test.ts
@@ -31,7 +31,7 @@ test(function envPermissionDenied1(): void {
err = e;
}
assertNotEquals(err, undefined);
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
@@ -43,7 +43,7 @@ test(function envPermissionDenied2(): void {
err = e;
}
assertNotEquals(err, undefined);
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
@@ -262,7 +262,7 @@ testPerm({ env: true }, function getDir(): void {
testPerm({}, function getDirWithoutPermission(): void {
assertThrows(
() => Deno.dir("home"),
- Deno.Err.PermissionDenied,
+ Deno.errors.PermissionDenied,
`run again with the --allow-env flag`
);
});
@@ -277,7 +277,7 @@ testPerm({ env: false }, function execPathPerm(): void {
Deno.execPath();
} catch (err) {
caughtError = true;
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
}
assert(caughtError);
@@ -294,7 +294,7 @@ testPerm({ env: false }, function loadavgPerm(): void {
Deno.loadavg();
} catch (err) {
caughtError = true;
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
}
assert(caughtError);
@@ -310,7 +310,7 @@ testPerm({ env: false }, function hostnamePerm(): void {
Deno.hostname();
} catch (err) {
caughtError = true;
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
}
assert(caughtError);
diff --git a/cli/js/process_test.ts b/cli/js/process_test.ts
index 51ba8bfb3..fc9d15140 100644
--- a/cli/js/process_test.ts
+++ b/cli/js/process_test.ts
@@ -14,7 +14,7 @@ test(function runPermissions(): void {
Deno.run({ args: ["python", "-c", "print('hello world')"] });
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
@@ -68,7 +68,7 @@ testPerm({ run: true }, function runNotFound(): void {
error = e;
}
assert(error !== undefined);
- assert(error instanceof Deno.Err.NotFound);
+ assert(error instanceof Deno.errors.NotFound);
});
testPerm(
@@ -321,7 +321,7 @@ if (Deno.build.os !== "win") {
Deno.kill(Deno.pid, Deno.Signal.SIGCONT);
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
diff --git a/cli/js/read_dir_test.ts b/cli/js/read_dir_test.ts
index 4496d7447..97a2e871a 100644
--- a/cli/js/read_dir_test.ts
+++ b/cli/js/read_dir_test.ts
@@ -32,7 +32,7 @@ testPerm({ read: false }, function readDirSyncPerm(): void {
Deno.readDirSync("tests/");
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
@@ -59,7 +59,7 @@ testPerm({ read: true }, function readDirSyncNotFound(): void {
src = Deno.readDirSync("bad_dir_name");
} catch (err) {
caughtError = true;
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
}
assert(caughtError);
assertEquals(src, undefined);
@@ -76,7 +76,7 @@ testPerm({ read: false }, async function readDirPerm(): Promise<void> {
await Deno.readDir("tests/");
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
diff --git a/cli/js/read_file_test.ts b/cli/js/read_file_test.ts
index 726f08413..256568587 100644
--- a/cli/js/read_file_test.ts
+++ b/cli/js/read_file_test.ts
@@ -16,7 +16,7 @@ testPerm({ read: false }, function readFileSyncPerm(): void {
Deno.readFileSync("cli/tests/fixture.json");
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
@@ -28,7 +28,7 @@ testPerm({ read: true }, function readFileSyncNotFound(): void {
data = Deno.readFileSync("bad_filename");
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.NotFound);
+ assert(e instanceof Deno.errors.NotFound);
}
assert(caughtError);
assert(data === undefined);
@@ -49,7 +49,7 @@ testPerm({ read: false }, async function readFilePerm(): Promise<void> {
await Deno.readFile("cli/tests/fixture.json");
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
diff --git a/cli/js/read_link_test.ts b/cli/js/read_link_test.ts
index 6f028c08d..498b65c0a 100644
--- a/cli/js/read_link_test.ts
+++ b/cli/js/read_link_test.ts
@@ -21,7 +21,7 @@ testPerm({ read: false }, async function readlinkSyncPerm(): Promise<void> {
Deno.readlinkSync("/symlink");
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
@@ -33,7 +33,7 @@ testPerm({ read: true }, function readlinkSyncNotFound(): void {
data = Deno.readlinkSync("bad_filename");
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.NotFound);
+ assert(e instanceof Deno.errors.NotFound);
}
assert(caughtError);
assertEquals(data, undefined);
@@ -61,7 +61,7 @@ testPerm({ read: false }, async function readlinkPerm(): Promise<void> {
await Deno.readlink("/symlink");
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
diff --git a/cli/js/realpath_test.ts b/cli/js/realpath_test.ts
index 6dfec45fc..8242c325e 100644
--- a/cli/js/realpath_test.ts
+++ b/cli/js/realpath_test.ts
@@ -31,7 +31,7 @@ testPerm({ read: false }, function realpathSyncPerm(): void {
Deno.realpathSync("some_file");
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
@@ -42,7 +42,7 @@ testPerm({ read: true }, function realpathSyncNotFound(): void {
Deno.realpathSync("bad_filename");
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.NotFound);
+ assert(e instanceof Deno.errors.NotFound);
}
assert(caughtError);
});
@@ -80,7 +80,7 @@ testPerm({ read: false }, async function realpathPerm(): Promise<void> {
await Deno.realpath("some_file");
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
@@ -91,7 +91,7 @@ testPerm({ read: true }, async function realpathNotFound(): Promise<void> {
await Deno.realpath("bad_filename");
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.NotFound);
+ assert(e instanceof Deno.errors.NotFound);
}
assert(caughtError);
});
diff --git a/cli/js/remove_test.ts b/cli/js/remove_test.ts
index cb89ea1a9..e7d07ebcc 100644
--- a/cli/js/remove_test.ts
+++ b/cli/js/remove_test.ts
@@ -18,7 +18,7 @@ testPerm({ write: true, read: true }, function removeSyncDirSuccess(): void {
err = e;
}
// Directory is gone
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
});
testPerm({ write: true, read: true }, function removeSyncFileSuccess(): void {
@@ -38,7 +38,7 @@ testPerm({ write: true, read: true }, function removeSyncFileSuccess(): void {
err = e;
}
// File is gone
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
});
testPerm({ write: true, read: true }, function removeSyncFail(): void {
@@ -67,7 +67,7 @@ testPerm({ write: true, read: true }, function removeSyncFail(): void {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
});
testPerm(
@@ -93,7 +93,7 @@ testPerm(
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
}
}
);
@@ -127,7 +127,7 @@ testPerm(
err = e;
}
Deno.removeSync(filePath);
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
}
}
);
@@ -139,7 +139,7 @@ testPerm({ write: false }, function removeSyncPerm(): void {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
@@ -158,7 +158,7 @@ testPerm({ write: true, read: true }, function removeAllSyncDirSuccess(): void {
err = e;
}
// Directory is gone
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
// REMOVE NON-EMPTY DIRECTORY
path = Deno.makeTempDirSync() + "/dir/subdir";
@@ -177,7 +177,7 @@ testPerm({ write: true, read: true }, function removeAllSyncDirSuccess(): void {
err = e;
}
// Directory is gone
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
});
testPerm(
@@ -199,7 +199,7 @@ testPerm(
err = e;
}
// File is gone
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
}
);
@@ -212,7 +212,7 @@ testPerm({ write: true }, function removeAllSyncFail(): void {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
});
testPerm({ write: false }, function removeAllSyncPerm(): void {
@@ -222,7 +222,7 @@ testPerm({ write: false }, function removeAllSyncPerm(): void {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
@@ -245,7 +245,7 @@ testPerm(
err = e;
}
// Directory is gone
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
}
);
@@ -268,7 +268,7 @@ testPerm(
err = e;
}
// File is gone
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
}
);
@@ -299,7 +299,7 @@ testPerm({ write: true, read: true }, async function removeFail(): Promise<
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
});
testPerm(
@@ -325,7 +325,7 @@ testPerm(
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
}
}
);
@@ -359,7 +359,7 @@ testPerm(
err = e;
}
Deno.removeSync(filePath);
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
}
}
);
@@ -371,7 +371,7 @@ testPerm({ write: false }, async function removePerm(): Promise<void> {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
@@ -392,7 +392,7 @@ testPerm(
err = e;
}
// Directory is gone
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
// REMOVE NON-EMPTY DIRECTORY
path = Deno.makeTempDirSync() + "/dir/subdir";
@@ -411,7 +411,7 @@ testPerm(
err = e;
}
// Directory is gone
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
}
);
@@ -434,7 +434,7 @@ testPerm(
err = e;
}
// File is gone
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
}
);
@@ -447,7 +447,7 @@ testPerm({ write: true }, async function removeAllFail(): Promise<void> {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
});
testPerm({ write: false }, async function removeAllPerm(): Promise<void> {
@@ -457,6 +457,6 @@ testPerm({ write: false }, async function removeAllPerm(): Promise<void> {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
diff --git a/cli/js/rename_test.ts b/cli/js/rename_test.ts
index 3673d8489..504a351ee 100644
--- a/cli/js/rename_test.ts
+++ b/cli/js/rename_test.ts
@@ -17,7 +17,7 @@ testPerm({ read: true, write: true }, function renameSyncSuccess(): void {
oldPathInfo = Deno.statSync(oldpath);
} catch (e) {
caughtErr = true;
- assert(e instanceof Deno.Err.NotFound);
+ assert(e instanceof Deno.errors.NotFound);
}
assert(caughtErr);
assertEquals(oldPathInfo, undefined);
@@ -32,7 +32,7 @@ testPerm({ read: false, write: true }, function renameSyncReadPerm(): void {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
@@ -45,7 +45,7 @@ testPerm({ read: true, write: false }, function renameSyncWritePerm(): void {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
@@ -67,7 +67,7 @@ testPerm({ read: true, write: true }, async function renameSuccess(): Promise<
oldPathInfo = Deno.statSync(oldpath);
} catch (e) {
caughtErr = true;
- assert(e instanceof Deno.Err.NotFound);
+ assert(e instanceof Deno.errors.NotFound);
}
assert(caughtErr);
assertEquals(oldPathInfo, undefined);
diff --git a/cli/js/stat_test.ts b/cli/js/stat_test.ts
index 3914f877c..98ef091ab 100644
--- a/cli/js/stat_test.ts
+++ b/cli/js/stat_test.ts
@@ -23,7 +23,7 @@ testPerm({ read: false }, async function statSyncPerm(): Promise<void> {
Deno.statSync("README.md");
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
@@ -36,7 +36,7 @@ testPerm({ read: true }, async function statSyncNotFound(): Promise<void> {
badInfo = Deno.statSync("bad_file_name");
} catch (err) {
caughtError = true;
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
}
assert(caughtError);
@@ -63,7 +63,7 @@ testPerm({ read: false }, async function lstatSyncPerm(): Promise<void> {
Deno.lstatSync("README.md");
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
@@ -76,7 +76,7 @@ testPerm({ read: true }, async function lstatSyncNotFound(): Promise<void> {
badInfo = Deno.lstatSync("bad_file_name");
} catch (err) {
caughtError = true;
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
}
assert(caughtError);
@@ -103,7 +103,7 @@ testPerm({ read: false }, async function statPerm(): Promise<void> {
await Deno.stat("README.md");
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
@@ -116,7 +116,7 @@ testPerm({ read: true }, async function statNotFound(): Promise<void> {
badInfo = await Deno.stat("bad_file_name");
} catch (err) {
caughtError = true;
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
}
assert(caughtError);
@@ -143,7 +143,7 @@ testPerm({ read: false }, async function lstatPerm(): Promise<void> {
await Deno.lstat("README.md");
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
@@ -156,7 +156,7 @@ testPerm({ read: true }, async function lstatNotFound(): Promise<void> {
badInfo = await Deno.lstat("bad_file_name");
} catch (err) {
caughtError = true;
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
}
assert(caughtError);
diff --git a/cli/js/streams/pipe-to.ts b/cli/js/streams/pipe-to.ts
index 01608b955..1d5579217 100644
--- a/cli/js/streams/pipe-to.ts
+++ b/cli/js/streams/pipe-to.ts
@@ -50,7 +50,7 @@
// abortAlgorithm = (): void => {
// // TODO this should be a DOMException,
// // https://github.com/stardazed/sd-streams/blob/master/packages/streams/src/pipe-to.ts#L38
-// const error = new Err.Aborted("Aborted");
+// const error = new errors.Aborted("Aborted");
// const actions: Array<() => Promise<void>> = [];
// if (preventAbort === false) {
// actions.push(() => {
diff --git a/cli/js/symlink_test.ts b/cli/js/symlink_test.ts
index b89b718b3..fbb2ec867 100644
--- a/cli/js/symlink_test.ts
+++ b/cli/js/symlink_test.ts
@@ -31,7 +31,7 @@ test(function symlinkSyncPerm(): void {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
diff --git a/cli/js/tls_test.ts b/cli/js/tls_test.ts
index dabbb2c89..698321274 100644
--- a/cli/js/tls_test.ts
+++ b/cli/js/tls_test.ts
@@ -13,7 +13,7 @@ test(async function connectTLSNoPerm(): Promise<void> {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
@@ -28,7 +28,7 @@ test(async function connectTLSCertFileNoReadPerm(): Promise<void> {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
@@ -51,7 +51,7 @@ testPerm(
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
try {
Deno.listenTLS({
@@ -61,7 +61,7 @@ testPerm(
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.NotFound);
+ assert(err instanceof Deno.errors.NotFound);
}
);
@@ -77,7 +77,7 @@ testPerm({ net: true }, async function listenTLSNoReadPerm(): Promise<void> {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
diff --git a/cli/js/truncate_test.ts b/cli/js/truncate_test.ts
index 42583354c..bec51b04d 100644
--- a/cli/js/truncate_test.ts
+++ b/cli/js/truncate_test.ts
@@ -58,7 +58,7 @@ testPerm({ write: false }, function truncateSyncPerm(): void {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
@@ -69,6 +69,6 @@ testPerm({ write: false }, async function truncatePerm(): Promise<void> {
} catch (e) {
err = e;
}
- assert(err instanceof Deno.Err.PermissionDenied);
+ assert(err instanceof Deno.errors.PermissionDenied);
assertEquals(err.name, "PermissionDenied");
});
diff --git a/cli/js/utime_test.ts b/cli/js/utime_test.ts
index c7e4293bf..7d6a72f47 100644
--- a/cli/js/utime_test.ts
+++ b/cli/js/utime_test.ts
@@ -78,7 +78,7 @@ testPerm({ read: true, write: true }, function utimeSyncNotFound(): void {
Deno.utimeSync("/baddir", atime, mtime);
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.NotFound);
+ assert(e instanceof Deno.errors.NotFound);
}
assert(caughtError);
});
@@ -92,7 +92,7 @@ testPerm({ read: true, write: false }, function utimeSyncPerm(): void {
Deno.utimeSync("/some_dir", atime, mtime);
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
@@ -157,7 +157,7 @@ testPerm({ read: true, write: true }, async function utimeNotFound(): Promise<
await Deno.utime("/baddir", atime, mtime);
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.NotFound);
+ assert(e instanceof Deno.errors.NotFound);
}
assert(caughtError);
});
@@ -173,7 +173,7 @@ testPerm({ read: true, write: false }, async function utimeSyncPerm(): Promise<
await Deno.utime("/some_dir", atime, mtime);
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
diff --git a/cli/js/write_file_test.ts b/cli/js/write_file_test.ts
index 9f58f4460..d788748f8 100644
--- a/cli/js/write_file_test.ts
+++ b/cli/js/write_file_test.ts
@@ -22,7 +22,7 @@ testPerm({ write: true }, function writeFileSyncFail(): void {
Deno.writeFileSync(filename, data);
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.NotFound);
+ assert(e instanceof Deno.errors.NotFound);
}
assert(caughtError);
});
@@ -37,7 +37,7 @@ testPerm({ write: false }, function writeFileSyncPerm(): void {
Deno.writeFileSync(filename, data);
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
@@ -64,7 +64,7 @@ testPerm({ read: true, write: true }, function writeFileSyncCreate(): void {
Deno.writeFileSync(filename, data, { create: false });
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.NotFound);
+ assert(e instanceof Deno.errors.NotFound);
}
assert(caughtError);
@@ -125,7 +125,7 @@ testPerm(
await Deno.writeFile(filename, data);
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.NotFound);
+ assert(e instanceof Deno.errors.NotFound);
}
assert(caughtError);
}
@@ -143,7 +143,7 @@ testPerm({ read: true, write: false }, async function writeFilePerm(): Promise<
await Deno.writeFile(filename, data);
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.PermissionDenied);
+ assert(e instanceof Deno.errors.PermissionDenied);
}
assert(caughtError);
});
@@ -175,7 +175,7 @@ testPerm({ read: true, write: true }, async function writeFileCreate(): Promise<
await Deno.writeFile(filename, data, { create: false });
} catch (e) {
caughtError = true;
- assert(e instanceof Deno.Err.NotFound);
+ assert(e instanceof Deno.errors.NotFound);
}
assert(caughtError);