diff options
Diffstat (limited to 'ext/fs')
-rw-r--r-- | ext/fs/lib.rs | 6 | ||||
-rw-r--r-- | ext/fs/ops.rs | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/ext/fs/lib.rs b/ext/fs/lib.rs index 161eaa367..f4815fd29 100644 --- a/ext/fs/lib.rs +++ b/ext/fs/lib.rs @@ -91,7 +91,7 @@ impl FsPermissions for deno_permissions::PermissionsContainer { if resolved { self .check_special_file(path, api_name) - .map_err(FsError::PermissionDenied)?; + .map_err(FsError::NotCapable)?; return Ok(Cow::Borrowed(path)); } @@ -99,11 +99,11 @@ impl FsPermissions for deno_permissions::PermissionsContainer { let read = read || !write; if read { FsPermissions::check_read(self, path, api_name) - .map_err(|_| FsError::PermissionDenied("read"))?; + .map_err(|_| FsError::NotCapable("read"))?; } if write { FsPermissions::check_write(self, path, api_name) - .map_err(|_| FsError::PermissionDenied("write"))?; + .map_err(|_| FsError::NotCapable("write"))?; } Ok(Cow::Borrowed(path)) } 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) |