-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Handle better some errors #5791
Conversation
Fails on Windows:
|
4e2b6ac
to
8eb58b3
Compare
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 :)
8eb58b3
to
8e53ab0
Compare
8e53ab0
to
3d356d4
Compare
for these two fixes, it was breaking some Rust errors
tested in tests/misc/read-errors.sh