diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-02-24 15:48:35 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-24 15:48:35 -0500 |
commit | e1687c0a4616e90d4bbde42b13a0356a7f6a1e7d (patch) | |
tree | 9aff6a2281d87a2487f8ed98b0b3f0a8733d04b5 /std | |
parent | db597055958a9dbc9c8e633e01d9229b55d1d6ef (diff) |
rename Deno.Err -> Deno.errors (#4093)
Diffstat (limited to 'std')
-rw-r--r-- | std/fs/copy.ts | 4 | ||||
-rw-r--r-- | std/fs/empty_dir.ts | 4 | ||||
-rw-r--r-- | std/fs/ensure_dir.ts | 4 | ||||
-rw-r--r-- | std/fs/ensure_file.ts | 4 | ||||
-rw-r--r-- | std/fs/exists.ts | 4 | ||||
-rw-r--r-- | std/fs/expand_glob.ts | 2 | ||||
-rw-r--r-- | std/fs/walk_test.ts | 2 | ||||
-rwxr-xr-x | std/http/file_server.ts | 2 | ||||
-rw-r--r-- | std/node/module.ts | 2 | ||||
-rw-r--r-- | std/node/process_test.ts | 2 | ||||
-rwxr-xr-x | std/testing/runner.ts | 2 |
11 files changed, 16 insertions, 16 deletions
diff --git a/std/fs/copy.ts b/std/fs/copy.ts index ec51784c6..d19c120f7 100644 --- a/std/fs/copy.ts +++ b/std/fs/copy.ts @@ -29,7 +29,7 @@ async function ensureValidCopy( try { destStat = await Deno.lstat(dest); } catch (err) { - if (err instanceof Deno.Err.NotFound) { + if (err instanceof Deno.errors.NotFound) { return; } throw err; @@ -57,7 +57,7 @@ function ensureValidCopySync( try { destStat = Deno.lstatSync(dest); } catch (err) { - if (err instanceof Deno.Err.NotFound) { + if (err instanceof Deno.errors.NotFound) { return; } throw err; diff --git a/std/fs/empty_dir.ts b/std/fs/empty_dir.ts index 0ac5e6420..a848e90a1 100644 --- a/std/fs/empty_dir.ts +++ b/std/fs/empty_dir.ts @@ -20,7 +20,7 @@ export async function emptyDir(dir: string): Promise<void> { } } } catch (err) { - if (!(err instanceof Deno.Err.NotFound)) { + if (!(err instanceof Deno.errors.NotFound)) { throw err; } @@ -49,7 +49,7 @@ export function emptyDirSync(dir: string): void { } } } catch (err) { - if (!(err instanceof Deno.Err.NotFound)) { + if (!(err instanceof Deno.errors.NotFound)) { throw err; } // if not exist. then create it diff --git a/std/fs/ensure_dir.ts b/std/fs/ensure_dir.ts index b6cc3150a..a74261c61 100644 --- a/std/fs/ensure_dir.ts +++ b/std/fs/ensure_dir.ts @@ -16,7 +16,7 @@ export async function ensureDir(dir: string): Promise<void> { ); } } catch (err) { - if (err instanceof Deno.Err.NotFound) { + if (err instanceof Deno.errors.NotFound) { // if dir not exists. then create it. await mkdir(dir, { recursive: true }); return; @@ -39,7 +39,7 @@ export function ensureDirSync(dir: string): void { ); } } catch (err) { - if (err instanceof Deno.Err.NotFound) { + if (err instanceof Deno.errors.NotFound) { // if dir not exists. then create it. mkdirSync(dir, { recursive: true }); return; diff --git a/std/fs/ensure_file.ts b/std/fs/ensure_file.ts index be824b7ba..77732164a 100644 --- a/std/fs/ensure_file.ts +++ b/std/fs/ensure_file.ts @@ -23,7 +23,7 @@ export async function ensureFile(filePath: string): Promise<void> { } } catch (err) { // if file not exists - if (err instanceof Deno.Err.NotFound) { + if (err instanceof Deno.errors.NotFound) { // ensure dir exists await ensureDir(path.dirname(filePath)); // create file @@ -54,7 +54,7 @@ export function ensureFileSync(filePath: string): void { } } catch (err) { // if file not exists - if (err instanceof Deno.Err.NotFound) { + if (err instanceof Deno.errors.NotFound) { // ensure dir exists ensureDirSync(path.dirname(filePath)); // create file diff --git a/std/fs/exists.ts b/std/fs/exists.ts index 2cd415173..ae64cb1f3 100644 --- a/std/fs/exists.ts +++ b/std/fs/exists.ts @@ -7,7 +7,7 @@ export async function exists(filePath: string): Promise<boolean> { return lstat(filePath) .then((): boolean => true) .catch((err: Error): boolean => { - if (err instanceof Deno.Err.NotFound) { + if (err instanceof Deno.errors.NotFound) { return false; } @@ -23,7 +23,7 @@ export function existsSync(filePath: string): boolean { lstatSync(filePath); return true; } catch (err) { - if (err instanceof Deno.Err.NotFound) { + if (err instanceof Deno.errors.NotFound) { return false; } throw err; diff --git a/std/fs/expand_glob.ts b/std/fs/expand_glob.ts index 61fca9602..c6653eda1 100644 --- a/std/fs/expand_glob.ts +++ b/std/fs/expand_glob.ts @@ -43,7 +43,7 @@ function split(path: string): SplitPath { } function throwUnlessNotFound(error: Error): void { - if (!(error instanceof Deno.Err.NotFound)) { + if (!(error instanceof Deno.errors.NotFound)) { throw error; } } diff --git a/std/fs/walk_test.ts b/std/fs/walk_test.ts index f99f82eb5..caf806262 100644 --- a/std/fs/walk_test.ts +++ b/std/fs/walk_test.ts @@ -235,7 +235,7 @@ testWalk( async function nonexistentRoot(): Promise<void> { await assertThrowsAsync(async () => { await walkArray("nonexistent"); - }, Deno.Err.NotFound); + }, Deno.errors.NotFound); } ); diff --git a/std/http/file_server.ts b/std/http/file_server.ts index acc3a20cd..da2b0b5a2 100755 --- a/std/http/file_server.ts +++ b/std/http/file_server.ts @@ -163,7 +163,7 @@ async function serveDir( } async function serveFallback(req: ServerRequest, e: Error): Promise<Response> { - if (e instanceof Deno.Err.NotFound) { + if (e instanceof Deno.errors.NotFound) { return { status: 404, body: encoder.encode("Not found") diff --git a/std/node/module.ts b/std/node/module.ts index aecf03ede..3520d804b 100644 --- a/std/node/module.ts +++ b/std/node/module.ts @@ -57,7 +57,7 @@ function stat(filename: string): StatResult { if (statCache !== null) statCache.set(filename, result); return result; } catch (e) { - if (e instanceof Deno.Err.PermissionDenied) { + if (e instanceof Deno.errors.PermissionDenied) { throw new Error("CJS loader requires --allow-read."); } return -1; diff --git a/std/node/process_test.ts b/std/node/process_test.ts index 545b6ce23..f44143acb 100644 --- a/std/node/process_test.ts +++ b/std/node/process_test.ts @@ -24,7 +24,7 @@ test({ () => { process.chdir("non-existent-directory-name"); }, - Deno.Err.NotFound, + Deno.errors.NotFound, "file" // On every OS Deno returns: "No such file" except for Windows, where it's: // "The system cannot find the file specified. (os error 2)" so "file" is diff --git a/std/testing/runner.ts b/std/testing/runner.ts index 772e02724..65b7be66d 100755 --- a/std/testing/runner.ts +++ b/std/testing/runner.ts @@ -182,7 +182,7 @@ export async function runTestModules({ if (moduleCount == 0) { const noneFoundMessage = "No matching test modules found."; if (!allowNone) { - throw new Deno.Err.NotFound(noneFoundMessage); + throw new Deno.errors.NotFound(noneFoundMessage); } else if (!disableLog) { console.log(noneFoundMessage); } |