-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Handle better some errors #5791
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
Conversation
Fails on Windows:
|
Err(e) => { | ||
set_exit_code(1); | ||
show_error!("error reading input: {}", e); | ||
return Ok(()); | ||
} |
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.
This feels very similar to what UIoError
does, but this is also quite clear, so it's fine.
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.
not sure how to do that with the Ok? do you we have other examples ?
tests/by-util/test_factor.rs
Outdated
|
||
#[test] | ||
fn fails_on_directory() { | ||
new_ucmd!().arg("<").arg(".").fails(); |
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.
This fails as it should, but not for the reason you're expecting. The <
will not pipe here. It will be an argument to factor
, so factor '<' '.'
.
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.
ah ah, fun :)
for these two fixes, it was breaking some Rust errors
tested in tests/misc/read-errors.sh