mirror of
https://github.com/denoland/deno.git
synced 2025-08-02 18:12:39 +00:00
std/node: better error message for read perm in require() (#3502)
This commit is contained in:
parent
de94698915
commit
33d2e3d536
1 changed files with 3 additions and 0 deletions
|
@ -54,6 +54,9 @@ function stat(filename: string): StatResult {
|
|||
if (statCache !== null) statCache.set(filename, result);
|
||||
return result;
|
||||
} catch (e) {
|
||||
if (e.kind === Deno.ErrorKind.PermissionDenied) {
|
||||
throw new Error("CJS loader requires --allow-read.");
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue