summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
authorBartek Iwańczuk <biwanczuk@gmail.com>2020-01-28 03:13:17 +0100
committerRyan Dahl <ry@tinyclouds.org>2020-01-27 21:13:17 -0500
commitf32c31a0eba90b6b1f711a2d5dfe182157d3ecb5 (patch)
tree9b9cc0f4d141586a692264c65eb4b96d0fc93a09 /cli/tests
parentac10d79d231d3b66b918764b9706597321850687 (diff)
dx: descriptive permission errors (#3808)
Before: ``` ▶ target/debug/deno https://deno.land/std/examples/echo_server.ts error: Uncaught PermissionDenied: run again with the --allow-net flag ► $deno$/dispatch_json.ts:40:11 at DenoError ($deno$/errors.ts:20:5) at unwrapResponse ($deno$/dispatch_json.ts:40:11) at sendSync ($deno$/dispatch_json.ts:67:10) at listen ($deno$/net.ts:170:15) at https://deno.land/std/examples/echo_server.ts:4:23 ``` ``` ▶ target/debug/deno --allow-read=/usr https://deno.land/std/examples/cat.ts /etc/passwd error: Uncaught PermissionDenied: run again with the --allow-read flag ► $deno$/dispatch_json.ts:40:11 at DenoError ($deno$/errors.ts:20:5) at unwrapResponse ($deno$/dispatch_json.ts:40:11) at sendAsync ($deno$/dispatch_json.ts:91:10) ``` After: ``` ▶ target/debug/deno https://deno.land/std/examples/echo_server.ts error: Uncaught PermissionDenied: network access to "0.0.0.0:8080", run again with the --allow-net flag ► $deno$/dispatch_json.ts:40:11 at DenoError ($deno$/errors.ts:20:5) at unwrapResponse ($deno$/dispatch_json.ts:40:11) at sendSync ($deno$/dispatch_json.ts:67:10) at listen ($deno$/net.ts:170:15) at https://deno.land/std/examples/echo_server.ts:4:23 ``` ``` ▶ target/debug/deno --allow-read=/usr https://deno.land/std/examples/cat.ts /etc/passwd error: Uncaught PermissionDenied: read access to "/etc/passwd", run again with the --allow-read flag ► $deno$/dispatch_json.ts:40:11 at DenoError ($deno$/errors.ts:20:5) at unwrapResponse ($deno$/dispatch_json.ts:40:11) at sendAsync ($deno$/dispatch_json.ts:91:10) ```
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/error_015_dynamic_import_permissions.out2
-rw-r--r--cli/tests/error_016_dynamic_import_permissions2.out2
2 files changed, 2 insertions, 2 deletions
diff --git a/cli/tests/error_015_dynamic_import_permissions.out b/cli/tests/error_015_dynamic_import_permissions.out
index 2c8c388fc..dcc913e2b 100644
--- a/cli/tests/error_015_dynamic_import_permissions.out
+++ b/cli/tests/error_015_dynamic_import_permissions.out
@@ -1 +1 @@
-error: Uncaught TypeError: run again with the --allow-net flag
+error: Uncaught TypeError: network access to "http://localhost:4545/tests/subdir/mod4.js", run again with the --allow-net flag
diff --git a/cli/tests/error_016_dynamic_import_permissions2.out b/cli/tests/error_016_dynamic_import_permissions2.out
index 55579f829..8f561f130 100644
--- a/cli/tests/error_016_dynamic_import_permissions2.out
+++ b/cli/tests/error_016_dynamic_import_permissions2.out
@@ -1,2 +1,2 @@
[WILDCARD]
-error: Uncaught TypeError: run again with the --allow-read flag
+error: Uncaught TypeError: read access to "[WILDCARD]passwd", run again with the --allow-read flag