Skip to content

Passing a invalid filename causes a crash #26

@poliorcetics

Description

@poliorcetics

Describe the bug

Passing an invalid filename to hx causes it to crash on a Result:

To Reproduce
Steps to reproduce the behavior:

$ hx toto
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', $HOME/.config/rust/cargo/registry/src/github.com-1ecc6299db9ec823/hx-0.3.0/src/lib.rs:238:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Expected behavior

I expected the program to tell me I made a mistake.

Desktop (please complete the following information):

  • OS: macOS 10.15.7

Additional context

$ hx --version
hx 0.3.0

I'll probably have the time to open a PR for a fix tomorrow if wanted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions