Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clarify error message when reporting debugger missing #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

adrienthebo
Copy link

When running cargo-debug with the default debugger (gdb) absent a panic will be generated:

❮ cargo debug build -- -- pubchem view data 13360
args: ["/Users/user/.cargo/bin/cargo-debug", "debug", "build", "--", "--", "pubchem", "view", "data", "13360"]
    Finished dev [unoptimized + debuginfo] target(s) in 0.12s
03:16:12 [INFO] selected binary: "/Users/user/personal/projects/histamix/target/debug/histamix"
thread 'main' panicked at src/main.rs:275:24:
error running debug command: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The panic message doesn't clear indicate that it's the debugger binary that's absent.

This commit adds a bit more error handling to the debugger execution to indicate the cause of the error and suggest a remediation.

When running cargo-debug with the default debugger (gdb) absent a panic will be generated:

```
❮ cargo debug build -- -- pubchem view data 13360
args: ["/Users/user/.cargo/bin/cargo-debug", "debug", "build", "--", "--", "pubchem", "view", "data", "13360"]
    Finished dev [unoptimized + debuginfo] target(s) in 0.12s
03:16:12 [INFO] selected binary: "/Users/user/personal/projects/histamix/target/debug/histamix"
thread 'main' panicked at src/main.rs:275:24:
error running debug command: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```

The panic message doesn't clear indicate that it's the debugger
binary that's absent.

This commit adds a bit more error handling to the debugger execution
to indicate the cause of the error and suggest a remediation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant