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 --- ext/fs/ops.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/fs/ops.rs') diff --git a/ext/fs/ops.rs b/ext/fs/ops.rs index dc279b60d..8af2f0045 100644 --- a/ext/fs/ops.rs +++ b/ext/fs/ops.rs @@ -60,7 +60,7 @@ fn map_permission_error( path: &Path, ) -> AnyError { match error { - FsError::PermissionDenied(err) => { + FsError::NotCapable(err) => { let path = format!("{path:?}"); let (path, truncated) = if path.len() > 1024 { (&path[0..1024], "...(truncated)") @@ -74,7 +74,7 @@ fn map_permission_error( format!( "Requires {err} access to {path}{truncated}, run again with the --allow-{err} flag") }; - custom_error("PermissionDenied", msg) + custom_error("NotCapable", msg) } err => Err::<(), _>(err) .context_path(operation, path) -- cgit v1.2.3