From 7bfcb4dd10d31f5f9566c90a28449c0951f3a48e Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Tue, 10 Sep 2024 20:12:24 +0200 Subject: feat(cli): use NotCapable error for permission errors (#25431) Closes #7394 --------- Co-authored-by: snek --- tests/integration/compile_tests.rs | 2 +- tests/integration/run_tests.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/integration') diff --git a/tests/integration/compile_tests.rs b/tests/integration/compile_tests.rs index 54a82b913..215b956fd 100644 --- a/tests/integration/compile_tests.rs +++ b/tests/integration/compile_tests.rs @@ -367,7 +367,7 @@ fn standalone_runtime_flags() { .run() .assert_stdout_matches_text("0.147205063401058\n") .assert_stderr_matches_text( - "[WILDCARD]PermissionDenied: Requires write access to[WILDCARD]", + "[WILDCARD]NotCapable: Requires write access to[WILDCARD]", ) .assert_exit_code(1); } diff --git a/tests/integration/run_tests.rs b/tests/integration/run_tests.rs index e18428575..9a680b944 100644 --- a/tests/integration/run_tests.rs +++ b/tests/integration/run_tests.rs @@ -3145,7 +3145,7 @@ fn issue9750() { console.write_line_raw("n"); console.expect_all(&[ "Denied env access to \"SECRET\".", - "PermissionDenied: Requires env access to \"SECRET\", run again with the --allow-env flag", + "NotCapable: Requires env access to \"SECRET\", run again with the --allow-env flag", ]); }); } @@ -4051,7 +4051,7 @@ async fn test_resolve_dns() { let out = String::from_utf8_lossy(&output.stdout); assert!(!output.status.success()); assert!(err.starts_with("Check file")); - assert!(err.contains(r#"error: Uncaught (in promise) PermissionDenied: Requires net access to "127.0.0.1:4553""#)); + assert!(err.contains(r#"error: Uncaught (in promise) NotCapable: Requires net access to "127.0.0.1:4553""#)); assert!(out.is_empty()); } @@ -4072,7 +4072,7 @@ async fn test_resolve_dns() { let out = String::from_utf8_lossy(&output.stdout); assert!(!output.status.success()); assert!(err.starts_with("Check file")); - assert!(err.contains(r#"error: Uncaught (in promise) PermissionDenied: Requires net access to "127.0.0.1:4553""#)); + assert!(err.contains(r#"error: Uncaught (in promise) NotCapable: Requires net access to "127.0.0.1:4553""#)); assert!(out.is_empty()); } -- cgit v1.2.3