Skip to content

Confusing error message when cd to non-existing directory #8027

Closed

Description

@Hofer-Julian

Describe the bug

If I want to cd into a non-existing directory, the error message adds confusing implementation details.

How to reproduce

nu ❯ cd askldjflasjk
Error: nu::shell::directory_not_found (link)

  × Directory not found
   ╭─[entry #1:1:1]
 1 │ cd askldjflasjk
   ·    ──────┬─────
   ·          ╰── directory not found
   ╰────
  help: IO Error: NotADirectory(Span { start: 85214, end: 85226 })

Expected behavior

The same thing but without NotADirectory(Span { start: 85214, end: 85226 })

Screenshots

No response

Configuration

key value
version 0.75.0
branch
commit_hash 17a265b
build_os windows-x86_64
build_target x86_64-pc-windows-msvc
rust_version rustc 1.66.1 (90743e729 2023-01-10)
rust_channel 1.66.1-x86_64-pc-windows-msvc
cargo_version cargo 1.66.1 (ad779e08b 2023-01-10)
pkg_version 0.75.0
build_time 2023-01-31 20:39:29 +00:00
build_rust_channel release
features database, default, trash, which, zip
installed_plugins

Additional context

No response

Activity

  1. fdncred commented on Feb 10, 2023

    @fdncred
    Contributor

    I think it's fine to have the IO error there like:

    help: IO Error: NotADirectory
    

    but not the span. Good catch.

  2. added
    good first issue
    A:error-unhelpful
    A:file-system
    on Feb 10, 2023
  3. ryand67 commented on Feb 11, 2023

    @ryand67
    Contributor

    I'd like to take a stab at this one if it's available!

  4. fdncred commented on Feb 11, 2023

    @fdncred
    Contributor

    Go for it @ryand67. Thanks for jumping in.

  5. added a commit that references this issue on Feb 13, 2023
  6. rgwood commented on Feb 13, 2023

    @rgwood
    Contributor

    Fixed in #8049

  7. added this to the v0.76.0 milestone on Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A:error-unhelpfulA:file-systemgood first issue

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions