-
Notifications
You must be signed in to change notification settings - Fork 30
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: nicer error message when mandatory args are missing. #247
Open
alekseifedotov
wants to merge
1
commit into
main
Choose a base branch
from
aleksei/flash-nicer-cli
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+6
−2
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Qbicz
approved these changes
Oct 1, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
When running `orb-hil flash` error message looks scary: before: ``` Error: 0: you must provide either rts-path or s3-url Location: hil/src/commands/flash.rs:71 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ⋮ 6 frames hidden ⋮ 7: orb_hil::commands::flash::Flash::run::{{closure}}::h47c7fdaa37681ba9 at /var/home/user/s/orb/software/hil/src/commands/flash.rs:71 8: orb_hil::main::{{closure}}::{{closure}}::h36e7f8c1fcea41b4 at /var/home/user/s/orb/software/hil/src/main.rs:61 9: orb_hil::main::{{closure}}::{{closure}}::h7efb28c6afe652a3 at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/macros/select.rs:557 10: <tokio::future::poll_fn::PollFn<F> as core::future::future::Future>::poll::h2eac7c48b400a86c at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/future/poll_fn.rs:58 11: orb_hil::main::{{closure}}::hd080318d4af69ecf at /var/home/user/s/orb/software/hil/src/main.rs:67 12: <core::pin::Pin<P> as core::future::future::Future>::poll::h3deb3e24bf77cdb1 at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/core/src/future/future.rs:123 13: tokio::runtime::park::CachedParkThread::block_on::{{closure}}::h9987587e480f34d7 at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/park.rs:281 14: tokio::runtime::coop::with_budget::h54b07592779aa816 at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/coop.rs:107 15: tokio::runtime::coop::budget::h05bbc6d89074cce0 at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/coop.rs:73 16: tokio::runtime::park::CachedParkThread::block_on::h7a58e96f17efc25c at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/park.rs:281 17: tokio::runtime::context::blocking::BlockingRegionGuard::block_on::hc7718b5beb89be53 at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/context/blocking.rs:66 18: tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}::h42267b2512734279 at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/scheduler/multi_thread/mod.rs:87 19: tokio::runtime::context::runtime::enter_runtime::h9b729c0594cd6e2f at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/context/runtime.rs:65 20: tokio::runtime::scheduler::multi_thread::MultiThread::block_on::he4525a3aefaaac61 at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/scheduler/multi_thread/mod.rs:86 21: tokio::runtime::runtime::Runtime::block_on_inner::h2ee3261bdef73ded at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/runtime.rs:363 22: tokio::runtime::runtime::Runtime::block_on::h896961fccd2a6044 at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.40.0/src/runtime/runtime.rs:333 23: orb_hil::main::h23b26eec6c27f850 at /var/home/user/s/orb/software/hil/src/main.rs:67 24: core::ops::function::FnOnce::call_once::hf4ac9d2d18d88439 at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/core/src/ops/function.rs:250 25: std::sys::backtrace::__rust_begin_short_backtrace::hfd91b22746c72256 at /builddir/build/BUILD/rust-1.81.0-build/rustc-1.81.0-src/library/std/src/sys/backtrace.rs:152 ⋮ 15 frames hidden ⋮ Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering. Run with RUST_BACKTRACE=full to include source snippets. ``` after: ``` error: the following required arguments were not provided: --s3-url <S3_URL> --rts-path <RTS_PATH> Usage: orb-hil flash --s3-url <S3_URL> --rts-path <RTS_PATH> For more information, try '--help'. ```
alekseifedotov
force-pushed
the
aleksei/flash-nicer-cli
branch
from
October 1, 2024 11:29
279d1dc
to
9d532ea
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When running
orb-hil flash
without s3_url or rts_path, the error message looks scary. All that backtrace makes an impression that the app crashed.This PR configures clap to print a nice warning if the path to rtf is missing.
--
before:
after: