Skip to content

Bad error message in path exists? #7696

Closed

Description

@webbedspace

Describe the bug

image
Something seems wrong with this line in exists.rs. Doesn't .try_exists() return a Rust Error in the Err() arm instead of a ShellError?

How to reproduce

I tried testing it out, and got this:

〉'C:\System Volume Information' | path exists
Error: nu::shell::io_error (link)

  × I/O error
  help: Os { code: 5, kind: PermissionDenied, message: "Access is denied." }

Expected behavior

At least, the above example should produce a proper ShellError with arrows and so forth.

Screenshots

No response

Configuration

key value
version 0.73.0
branch main
commit_hash 1291b64
build_os windows-x86_64
build_target x86_64-pc-windows-msvc
rust_version rustc 1.65.0 (897e37553 2022-11-02)
rust_channel 1.65.0-x86_64-pc-windows-msvc
cargo_version cargo 1.65.0 (4bc8f24d3 2022-10-20)
pkg_version 0.73.0
build_time 2022-12-21 16:52:27 +10:00
build_rust_channel release
features database, default, trash, which, zip
installed_plugins

Additional context

No response

Activity

  1. fdncred commented on Jan 6, 2023

    @fdncred
    Contributor

    I think try_exist() returns a Result<bool>, Ok(true or false) or Err(_), seen here https://doc.rust-lang.org/stable/std/path/struct.Path.html#method.try_exists, but definitely not a ShellError

  2. added
    A:error-unhelpful
    on Jan 12, 2023
  3. added a commit that references this issue on Jan 12, 2023
    48b7b41
  4. added this to the v0.75 milestone on Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:error-unhelpful

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions