diff options
Diffstat (limited to 'std/node')
-rw-r--r-- | std/node/module.ts | 2 | ||||
-rw-r--r-- | std/node/process_test.ts | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/std/node/module.ts b/std/node/module.ts index 547c76bab..aecf03ede 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.kind === Deno.ErrorKind.PermissionDenied) { + if (e instanceof Deno.Err.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 51dbcd630..545b6ce23 100644 --- a/std/node/process_test.ts +++ b/std/node/process_test.ts @@ -24,13 +24,11 @@ test({ () => { process.chdir("non-existent-directory-name"); }, - Deno.DenoError, + Deno.Err.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 // the only common string here. - // TODO(rsp): Crazy idea: 404 for things like this? - // It would be nice to have error codes like 404 or 403 in addition to strings. ); } }); |