mirror of
https://github.com/tauri-apps/deno.git
synced 2026-02-04 02:31:19 +01:00
std/node: better error message for read perm in require() (#3502)
This commit is contained in:
committed by
Ry Dahl
parent
de94698915
commit
33d2e3d536
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user